From 20e84ebcc89b7a0a3d10d15a9c7299fe038635bc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 19 Oct 2020 09:40:34 +0530 Subject: [PATCH] Ensure valid data written to icon_data on windows --- src/calibre/gui2/open_with.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/open_with.py b/src/calibre/gui2/open_with.py index 3096ce9c37..91689bf76b 100644 --- a/src/calibre/gui2/open_with.py +++ b/src/calibre/gui2/open_with.py @@ -110,7 +110,7 @@ if iswindows: data = None import traceback traceback.print_exc() - if data: + if isinstance(data, (bytes, bytearray)) or data is None: entry['icon_data'] = data return entry