[Bf-blender-cvs] [3a1f77650de] blender2.8: WM: Fix crash in transform-orientation access

Campbell Barton noreply at git.blender.org
Mon Jun 26 00:34:32 CEST 2017


Commit: 3a1f77650dec7fe9d7f559748478d420ed59fc8c
Author: Campbell Barton
Date:   Mon Jun 26 08:38:21 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB3a1f77650dec7fe9d7f559748478d420ed59fc8c

WM: Fix crash in transform-orientation access

Need to support orientation access when context is NULL.

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

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

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

diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 364059d9c72..2af13103805 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -459,12 +459,12 @@ EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, P
 	}
 	else {
 		/* can't use scene from ptr->id.data because that enum is also used by operators */
-		workspace = CTX_wm_workspace(C);
+		workspace = C ? CTX_wm_workspace(C) : NULL;
 	}
 
-	transform_orientations = BKE_workspace_transform_orientations_get(workspace);
+	transform_orientations = workspace ? BKE_workspace_transform_orientations_get(workspace) : NULL;
 
-	if (BLI_listbase_is_empty(transform_orientations) == false) {
+	if (transform_orientations && (BLI_listbase_is_empty(transform_orientations) == false)) {
 		RNA_enum_item_add_separator(&item, &totitem);
 
 		for (TransformOrientation *ts = transform_orientations->first; ts; ts = ts->next) {




More information about the Bf-blender-cvs mailing list