2.5
authorTon Roosendaal <ton@blender.org>
Tue, 10 Feb 2009 15:51:33 +0000 (15:51 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 10 Feb 2009 15:51:33 +0000 (15:51 +0000)
Bugfix: Node operators were called in empty node editor, causing
NULL reading. Prevented it from happening with more strict poll()

source/blender/editors/screen/screen_ops.c

index b2995836732e1f5ae6de8153626c59fd45b32f1e..6cd06faab68d879333ba494625ad1a3d0bf828be 100644 (file)
@@ -148,7 +148,12 @@ int ED_operator_buttons_active(bContext *C)
 
 int ED_operator_node_active(bContext *C)
 {
-       return ed_spacetype_test(C, SPACE_NODE);
+       if(ed_spacetype_test(C, SPACE_NODE)) {
+               SpaceNode *snode= (SpaceNode *)CTX_wm_space_data(C);
+               if(snode->edittree)
+                       return 1;
+       }
+       return 0;
 }
 
 int ED_operator_ipo_active(bContext *C)