Skip to content

Commit

Permalink
Fixes for no_home_in_files
Browse files Browse the repository at this point in the history
  • Loading branch information
strycore committed Apr 27, 2020
1 parent 732dbf8 commit 5e7bb29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion games/util/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,11 @@ def no_home_in_files(installer):
"""Installer files should not point to a local file."""
script = get_installer_script(installer)
for file_info in script.get('files') or []:
if not isinstance(file_info, dict):
continue
file_meta = file_info[next(iter(file_info.keys()))]
if isinstance(file_meta, dict):
url = file_meta["url"]
url = file_meta.get("url")
else:
url = file_meta
if url.startswith("/home"):
Expand Down

2 comments on commit 5e7bb29

@AlexanderRavenheart
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will give you a NoneType does not have startswith if url will get default None from file_meta.get("url").

@strycore
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

Please sign in to comment.