From f1c321d255fa5d7999b174aa4f9ce9daedc589a4 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Thu, 26 Sep 2019 09:42:01 +0100 Subject: [PATCH] RecentApp: Fix crash when location doesn't exist --- .../linuxmint/mintMenu/plugins/recentHelper.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/recentHelper.py b/usr/lib/linuxmint/mintMenu/plugins/recentHelper.py index 9f3d792..2e2d571 100644 --- a/usr/lib/linuxmint/mintMenu/plugins/recentHelper.py +++ b/usr/lib/linuxmint/mintMenu/plugins/recentHelper.py @@ -66,13 +66,14 @@ def recentAppBuildLauncher(location): if location.startswith("file://"): location = location[7:] - appButton = ApplicationLauncher(location, iconSize) - - if appButton.appExec: - appButton.show() - appButton.connect("clicked", applicationButtonClicked) - appButton.type = "location" - return appButton + if os.path.exists(location): + appButton = ApplicationLauncher(location, iconSize) + if appButton.appExec: + appButton.show() + appButton.connect("clicked", applicationButtonClicked) + appButton.type = "location" + return appButton + print("RecentApp: %s not found." % location) except Exception as e: print("File in recentapp not found: '%s': %s" % (location, e))