When finding PDF viewers, skip apps that do not have Info.plist files (as is the case with com.apple.system-library)

This commit is contained in:
Micah Lee 2020-03-12 15:21:09 -07:00
parent bacc2d714e
commit 2c0f0acbdf
No known key found for this signature in database
GPG key ID: 403C2657CD994F73

View file

@ -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)