WM: toggling expanded could raise exception

Missing module case wasn't checked for.
This commit is contained in:
Campbell Barton 2015-06-10 19:33:38 +10:00
parent bc69eafa98
commit 0446c73c4a
1 changed files with 4 additions and 10 deletions

View File

@ -2108,15 +2108,9 @@ class WM_OT_addon_expand(Operator):
module_name = self.module
# unlikely to fail, module should have already been imported
try:
# mod = __import__(module_name)
mod = addon_utils.addons_fake_modules.get(module_name)
except:
import traceback
traceback.print_exc()
return {'CANCELLED'}
mod = addon_utils.addons_fake_modules.get(module_name)
if mod is not None:
info = addon_utils.module_bl_info(mod)
info["show_expanded"] = not info["show_expanded"]
info = addon_utils.module_bl_info(mod)
info["show_expanded"] = not info["show_expanded"]
return {'FINISHED'}