From 235ea54a5c5cc4885d1b3a9cf9aef2bf94ddd273 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 21 Oct 2024 13:38:54 +0530 Subject: [PATCH] get_link_map() should not have None keys --- src/calibre/db/cache.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/db/cache.py b/src/calibre/db/cache.py index a8bccfd184..4ac9ebc7c5 100644 --- a/src/calibre/db/cache.py +++ b/src/calibre/db/cache.py @@ -2533,7 +2533,9 @@ class Cache: raise ValueError(f"Lookup name {for_field} doesn't have a link map") lm = table.link_map vm = table.id_map - return {vm.get(fid):v for fid,v in lm.items() if v} + ans = {vm.get(fid):v for fid,v in lm.items() if v} + ans.pop(None) + return ans @read_api def link_for(self, field, item_id):