Merge pull request #54 from firstlookmedia/43_macos_crash

When finding PDF viewers, skip apps that do not have Info.plist files
This commit is contained in:
Micah Lee 2020-03-12 23:27:26 +01:00 committed by GitHub
commit 7e398e2b28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)