Fixed BUG-121: crashing when cannot find a match when searching

This commit is contained in:
2024-01-01 11:49:41 +11:00
parent 9c4da5ec6f
commit 262efd89d4
3 changed files with 7 additions and 2 deletions

View File

@@ -283,6 +283,9 @@ def GetEntriesInSearchView( OPT ):
with db.engine.connect() as conn:
OPT.num_entries = conn.execute( text( num_e_sql ) ).first().count
if OPT.num_entries == 0:
return []
last_entry_sql= f"{sel_no_order} order by {OPT.last_order_raw} limit 1"
with db.engine.connect() as conn:
OPT.last_eid = conn.execute( text( last_entry_sql ) ).first().id