diff --git a/src/calibre/gui2/preferences/device_user_defined.py b/src/calibre/gui2/preferences/device_user_defined.py index ae963f61c1..40413593d8 100644 --- a/src/calibre/gui2/preferences/device_user_defined.py +++ b/src/calibre/gui2/preferences/device_user_defined.py @@ -64,6 +64,7 @@ class UserDefinedDevice(QDialog): res = '' if len(new_devices) == 1: def fmtid(x): + x = x or 0 if isinstance(x, numbers.Integral): x = hex(x) if not x.startswith('0x'):