Cycles: Fix an AttributeErro exceptionr on missing object context

This happens when the properties panel is pinned to the material tab.

Patch by Ralf Hölzemer (aka cheleb), thanks!

Differential Revision: https://developer.blender.org/D1776
This commit is contained in:
Sergey Sharybin 2016-02-10 10:34:19 +01:00
parent 2cbf32e0fb
commit 5237937a08
1 changed files with 1 additions and 1 deletions

View File

@ -610,9 +610,9 @@ class Cycles_PT_context_material(CyclesButtonsPanel, Panel):
ob = context.object
slot = context.material_slot
space = context.space_data
is_sortable = len(ob.material_slots) > 1
if ob:
is_sortable = len(ob.material_slots) > 1
rows = 1
if (is_sortable):
rows = 4