Add w->proto valid check for Widget_CheckType()

This commit is contained in:
Liu Chao
2017-12-17 16:31:35 +08:00
parent 80aac94eed
commit 3230914cd4
+3
View File
@@ -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;