From 4848aaaa7d43124d54bf0cc2bc7d46adb5027a23 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Thu, 13 Sep 2012 12:01:55 +0000 Subject: [PATCH] avoid crash due to plugin code at all cost svn: r20376 --- src/gui/viewmanager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/viewmanager.py b/src/gui/viewmanager.py index 11339c55c..7094eca97 100644 --- a/src/gui/viewmanager.py +++ b/src/gui/viewmanager.py @@ -1924,6 +1924,10 @@ def get_available_views(): mod = pmgr.load_plugin(pdata) if not mod or not hasattr(mod, pdata.viewclass): #import of plugin failed + try: + lasterror = pmgr.get_fail_list()[-1][1][1] + except: + lasterror = '*** No error found, probably error in gpr.py file ***' ErrorDialog( _('Failed Loading View'), _('The view %(name)s did not load and reported an error.\n\n' @@ -1937,7 +1941,7 @@ def get_available_views(): 'name': pdata.name, 'firstauthoremail': pdata.authors_email[0] if pdata.authors_email else '...', - 'error_msg': pmgr.get_fail_list()[-1][1][1]}) + 'error_msg': lasterror}) continue viewclass = getattr(mod, pdata.viewclass)