From 52c973ce797251adda97c985261585e7b0159903 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 16 Sep 2013 08:19:15 +0530 Subject: [PATCH] Handle broken code trying to set numeric columns with empty strings --- src/calibre/db/write.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/db/write.py b/src/calibre/db/write.py index 7207c268bc..175b484c91 100644 --- a/src/calibre/db/write.py +++ b/src/calibre/db/write.py @@ -83,7 +83,7 @@ def adapt_number(typ, x): if x is None: return None if isinstance(x, (unicode, bytes)): - if x.lower() == 'none': + if not x or x.lower() == 'none': return None return typ(x)