Add missing null check solving crash on texture panel, also fix possible 'freeing NULL' because of misplaced MEM_freeN() in that context.

This commit is contained in:
2010-04-26 20:30:13 +00:00
parent a547e91d41
commit 523b95898b

View File

@@ -1105,9 +1105,11 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, char *str, ui
if(flag & PROP_ID_SELF_CHECK)
if(itemptr.data == but->rnapoin.id.data)
continue;
if(RNA_struct_is_ID(itemptr.type))
if(itemptr.type && RNA_struct_is_ID(itemptr.type))
iconid= ui_id_icon_get((bContext*)C, itemptr.data, 0);
else
iconid = 0;
name= RNA_struct_name_get_alloc(&itemptr, NULL, 0);
@@ -1119,8 +1121,8 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, char *str, ui
cis->iconid = iconid;
BLI_addtail(items_list, cis);
}
MEM_freeN(name);
}
MEM_freeN(name);
i++;
}