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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-04-21 11:56:34 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-04-21 11:56:34 +0400
commit9c69a8028bac859bd5b429cdd4e7a652dd1d6d15 (patch)
tree84b9da636212ee665065acf8bd516d1e952181b0 /source
parent0ebcc8557f9852dcf7165399a63b3e583895509b (diff)
bugfix [#22091] Crashing on Add Shortcut
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/object/object_edit.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index a1d2a6d734a..1ac84eb48ce 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -119,11 +119,15 @@ static bContext *C;
static void error_libdata() {}
-/* find the correct active object per context */
+/* find the correct active object per context
+ * note: context can be NULL when called from a enum with PROP_ENUM_NO_CONTEXT */
Object *ED_object_active_context(bContext *C)
{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
- if (!ob) ob= CTX_data_active_object(C);
+ Object *ob= NULL;
+ if(C) {
+ ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ if (!ob) ob= CTX_data_active_object(C);
+ }
return ob;
}