Fix NULL pointer check

This commit is contained in:
Campbell Barton 2018-04-24 19:34:09 +02:00
parent d6e7ec6253
commit 0c4ceda75b
1 changed files with 2 additions and 2 deletions

View File

@ -2109,14 +2109,14 @@ const EnumPropertyItem *rna_TransformOrientation_itemf(
RNA_enum_items_add(&item, &totitem, transform_orientation_items);
Scene *scene = CTX_data_scene(C);
Scene *scene;
if (ptr->type == &RNA_Scene) {
scene = ptr->data;
}
else {
scene = CTX_data_scene(C);
}
const ListBase *transform_orientations = &scene->transform_spaces;
const ListBase *transform_orientations = scene ? &scene->transform_spaces : NULL;
if (transform_orientations && (BLI_listbase_is_empty(transform_orientations) == false)) {
RNA_enum_item_add_separator(&item, &totitem);