diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-10-20 01:37:44 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-10-20 01:37:44 +1100 |
| commit | 844b6e59db7240fab1faef9265fa0ce1ac706ea4 (patch) | |
| tree | 0b8732b4489a8204c36faa9b6e29b0c79c57e594 | |
| parent | 379fc207ef7b6e3286e7b8acc1137c4494176624 (diff) | |
Account for null pop in histplorer.py
| -rwxr-xr-x | backend/histplorer.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/backend/histplorer.py b/backend/histplorer.py index 5282592..e5c6c5a 100755 --- a/backend/histplorer.py +++ b/backend/histplorer.py @@ -271,7 +271,8 @@ def lookupEvents(start: HistDate | None, end: HistDate | None, ctg: str | None, results.append(eventEntryToResults(row)) # return results -def eventEntryToResults(row: tuple[int, str, int, int | None, int | None, int | None, int, str, int, int]) -> Event: +def eventEntryToResults( + row: tuple[int, str, int, int | None, int | None, int | None, int, str, int, int | None]) -> Event: eventId, title, start, startUpper, end, endUpper, fmt, ctg, imageId, pop = row """ Helper for converting an 'events' db entry into an Event object """ # Convert dates @@ -291,6 +292,8 @@ def eventEntryToResults(row: tuple[int, str, int, int | None, int | None, int | newDates[i] = HistDate(False, *jdnToJulian(n)) else: newDates[i] = HistDate(True, *jdnToGregorian(n)) + if pop is None: + pop = 0 # return Event(eventId, title, newDates[0], newDates[1], newDates[2], newDates[3], ctg, imageId, pop) |
