From 2c0f0acbdf864a2c6f60e5f5a3c7b3ebb362c584 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Thu, 12 Mar 2020 15:21:09 -0700 Subject: [PATCH] When finding PDF viewers, skip apps that do not have Info.plist files (as is the case with com.apple.system-library) --- dangerzone/global_common.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dangerzone/global_common.py b/dangerzone/global_common.py index f1d38d2..29c77e2 100644 --- a/dangerzone/global_common.py +++ b/dangerzone/global_common.py @@ -332,6 +332,11 @@ class GlobalCommon(object): # Load its plist file plist_path = os.path.join(app_path, "Contents/Info.plist") + + # Skip if there's not an Info.plist + if not os.path.exists(plist_path): + continue + with open(plist_path, "rb") as f: plist_data = f.read() plist_dict = plistlib.loads(plist_data)