Skip to content

Commit

Permalink
Check if key is set before trying to get value
Browse files Browse the repository at this point in the history
  • Loading branch information
emi420 committed Aug 28, 2024
1 parent bb83b34 commit 73eda02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/raw_backend
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def download_file(download_dir, source_path):
target_path = os.path.join(download_dir, filename)
if not os.path.exists(target_path):
print(f"\nStarting download for: {target_path}")
if os.environ["OSM_USERNAME"] and os.environ["OSM_PASSWORD"]:
if "OSM_USERNAME" in os.environ and os.environ["OSM_USERNAME"] and \
"OSM_PASSWORD" in os.environ and os.environ["OSM_PASSWORD"]:
cookies = verify_me_osm(
os.environ["OSM_USERNAME"], os.environ["OSM_PASSWORD"]
)
Expand Down

0 comments on commit 73eda02

Please sign in to comment.