From 9768129109e02e7771be6a40292fe6659da850bb Mon Sep 17 00:00:00 2001
From: dequis <dx@dxzone.com.ar>
Date: Fri, 4 Oct 2019 18:38:01 +0200
Subject: [PATCH] fix(preload): catch OSError if apps/ is missing

And show the no_apps_message instead of crashing
---
 preload/menu.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/preload/menu.py b/preload/menu.py
index e9077e361..bd9705a37 100644
--- a/preload/menu.py
+++ b/preload/menu.py
@@ -87,9 +87,12 @@ def no_apps_message():
 
 
 if __name__ == "__main__":
-    apps = list(enumerate_apps())
+    try:
+        apps = list(enumerate_apps())
+    except OSError:
+        apps = []
 
-    if apps == []:
+    if not apps:
         no_apps_message()
 
     MainMenu(apps).run()
-- 
GitLab