Skip to content

Commit

Permalink
Handle case were we cannot load device timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
DonnchaC committed Oct 28, 2024
1 parent 39f7885 commit 4a14c97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mvt/android/modules/androidqf/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ def check_indicators(self) -> None:
# TODO: adds SHA1 and MD5 when available in MVT

def run(self) -> None:
device_timezone = ZoneInfo(self._get_device_timezone())
if timezone := self._get_device_timezone():
device_timezone = ZoneInfo(timezone)
else:
self.log.warning("Unable to determine device timezone, using UTC")
device_timezone = ZoneInfo("UTC")

for file in self._get_files_by_pattern("*/files.json"):
rawdata = self._get_file_content(file).decode("utf-8", errors="ignore")
Expand Down

0 comments on commit 4a14c97

Please sign in to comment.