From ae81ae2b7230e0615d269779a60bd9c67be0d659 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 5 Jul 2021 10:35:09 +0530 Subject: [PATCH] Handle passing None to unicode_normalize --- src/calibre/db/annotations.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/db/annotations.py b/src/calibre/db/annotations.py index fa695e3075..83be2e3d65 100644 --- a/src/calibre/db/annotations.py +++ b/src/calibre/db/annotations.py @@ -12,8 +12,10 @@ no_cfi_sort_key = cfi_sort_key('/99999999') def unicode_normalize(text): - from unicodedata import normalize - return normalize('NFKC', text) + if text: + from unicodedata import normalize + text = normalize('NFKC', text) + return text def bookmark_sort_key(b):