Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-06-26 01:38:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-06-26 01:38:21 +0300
commit3a1f77650dec7fe9d7f559748478d420ed59fc8c (patch)
tree0a633e922cf08bf699ead8c99eb7cfbd479c4563 /source/blender/makesrna/intern/rna_space.c
parent70b5cec5fafc09fedb2a0cc2713565c4340a5536 (diff)
WM: Fix crash in transform-orientation access
Need to support orientation access when context is NULL.
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r--source/blender/makesrna/intern/rna_space.c6
1 files changed, 3 insertions, 3 deletions
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) {