Fix for last commit, missed check for ob, could cause errors when object was removed.
authorThomas Dinges <blender@dingto.org>
Fri, 6 Jan 2012 22:55:15 +0000 (22:55 +0000)
committerThomas Dinges <blender@dingto.org>
Fri, 6 Jan 2012 22:55:15 +0000 (22:55 +0000)
release/scripts/startup/bl_ui/space_node.py

index 9f714f8..edbcf3e 100644 (file)
@@ -48,7 +48,7 @@ class NODE_HT_header(Header):
             if scene.render.use_shading_nodes:
                 layout.prop(snode, "shader_type", text="", expand=True)
 
-            if not scene.render.use_shading_nodes or snode.shader_type == 'OBJECT':
+            if (not scene.render.use_shading_nodes or snode.shader_type == 'OBJECT') and ob:
                 # Show material.new when no active ID/slot exists
                 if not id_from and ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'METABALL'}:
                     layout.template_ID(ob, "active_material", new="material.new")