1
0
Fork 0
forked from len0rd/rockbox

skin_debug: Don't segfault when dump a viewport with no children

Change-Id: I5dfcc53a735dab1552211cdf522f4d18d93e6ec8
This commit is contained in:
Solomon Peachy 2024-05-24 11:16:46 -04:00
parent 2dc6947a2d
commit 8825b33052

View file

@ -43,6 +43,9 @@ static char* error_message;
static inline struct skin_element* static inline struct skin_element*
get_child(OFFSETTYPE(struct skin_element**) children, int child) get_child(OFFSETTYPE(struct skin_element**) children, int child)
{ {
if (children == NULL)
return NULL;
struct skin_element **kids = SKINOFFSETTOPTR(skin_buffer, children); struct skin_element **kids = SKINOFFSETTOPTR(skin_buffer, children);
return kids[child]; return kids[child];
} }