Fix error with image editor toolsystem when switching to some workspaces.

This commit is contained in:
Brecht Van Lommel 2018-08-17 12:59:24 +02:00
parent c9d5d311ec
commit 9f0f8aabe2
1 changed files with 4 additions and 1 deletions

View File

@ -1394,7 +1394,10 @@ class IMAGE_PT_tools_active(ToolSelectPanelHelper, Panel):
@classmethod
def tools_from_context(cls, context, mode=None):
if mode is None:
mode = context.space_data.mode
if context.space_data is None:
mode = context.space_data.mode
else:
mode = 'VIEW'
for tools in (cls._tools[None], cls._tools.get(mode, ())):
for item in tools:
if not (type(item) is ToolDef) and callable(item):