Fixed an exception if any of the markers failed to load.

This commit is contained in:
Marat Fayzullin 2024-09-11 16:12:25 -04:00
parent f37a7cf310
commit 9eec273de0
1 changed files with 6 additions and 4 deletions

View File

@ -243,10 +243,12 @@ class Markers(object):
# Update given markers on the map
def updateMap(self, markers):
# Create a timestamp far into the future, for permanent markers
permanent = datetime.now(timezone.utc) + timedelta(weeks=500)
for r in markers.values():
Map.getSharedInstance().updateLocation(r.getId(), r, r.getMode(), timestamp=permanent)
# Must have valid markers to update
if markers is not None:
# Create a timestamp far into the future, for permanent markers
permanent = datetime.now(timezone.utc) + timedelta(weeks=500)
for r in markers.values():
Map.getSharedInstance().updateLocation(r.getId(), r, r.getMode(), timestamp=permanent)
# Scrape online databases, updating cache file
def updateCache(self):