Fixed AttributeError when there is no object selected

This commit is contained in:
Sybren A. Stüvel 2018-06-28 12:53:30 +02:00
parent 98a0bcd425
commit 7ad0e8300d
1 changed files with 2 additions and 0 deletions

View File

@ -43,6 +43,8 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
@classmethod
def poll(cls, context):
ob = context.object
if not ob:
return False
return (context.engine in cls.COMPAT_ENGINES) and (ob.field) and (ob.field.type != 'NONE')
def draw(self, context):