Fix type enforcement

pull/4479/head
awsr 2025-12-17 13:44:25 -08:00
parent 6f00ad4643
commit 18bfa4b031
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -120,9 +120,9 @@ def atomically_save_image():
if not fn.endswith('.json'):
fn += '.json'
entries = shared.readfile(fn, silent=True)
idx = len(list(entries))
if idx == 0:
if not isinstance(entries, list):
entries = []
idx = len(entries)
entry = { 'id': idx, 'filename': filename, 'time': datetime.datetime.now().isoformat(), 'info': exifinfo }
entries.append(entry)
shared.writefile(entries, fn, mode='w', silent=True)