[Bf-blender-cvs] [0c4ceda75be] blender2.8: Fix NULL pointer check

Campbell Barton noreply at git.blender.org
Tue Apr 24 19:35:30 CEST 2018


Commit: 0c4ceda75bee3d2deb6c6b6d28c76cd49b8853c2
Author: Campbell Barton
Date:   Tue Apr 24 19:34:09 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB0c4ceda75bee3d2deb6c6b6d28c76cd49b8853c2

Fix NULL pointer check

===================================================================

M	source/blender/makesrna/intern/rna_scene.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index d9dd10d05bd..822ab119854 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -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);



More information about the Bf-blender-cvs mailing list