Fix for last commit, missed check for ob, could cause errors when object was removed.

This commit is contained in:
Thomas Dinges
2012-01-06 22:55:15 +00:00
parent d919c30ac3
commit 549c75fc61

View 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")