diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index 318183eb10..4f5a034222 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -426,6 +426,8 @@ class ResultCache(SearchQueryParser): # {{{ if l > 0: alt_loc = location[0:l] alt_item = location[l+1:] + else: + alt_loc = None for key in user_cats: if key == location or key.startswith(location + '.'): for (item, category, ign) in user_cats[key]: