From 3230914cd473793a769f00a92fd56a8e96ac64ea Mon Sep 17 00:00:00 2001 From: Liu Chao Date: Sun, 17 Dec 2017 16:31:35 +0800 Subject: [PATCH] Add w->proto valid check for Widget_CheckType() --- src/gui/widget_prototype.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/widget_prototype.c b/src/gui/widget_prototype.c index 5a462931..d83d3da7 100644 --- a/src/gui/widget_prototype.c +++ b/src/gui/widget_prototype.c @@ -112,6 +112,9 @@ LCUI_BOOL Widget_CheckType( LCUI_Widget w, const char *type ) if( strcmp( w->type, type ) == 0 ) { return TRUE; } + if( !w->proto ) { + return FALSE; + } for( proto = w->proto->proto; proto; proto = proto->proto ) { if( strcmp( proto->name, type ) == 0 ) { return TRUE;