From 696a93deea757540dfbb9f76f37281b7a09d5909 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 7 Oct 2019 16:01:22 +0530 Subject: [PATCH] Edit book: Font manager: Fix removing embedded font failing if @font-face rule has no src. Fixes #1847052 [Unable to remove font from font manager](https://bugs.launchpad.net/calibre/+bug/1847052) --- src/calibre/ebooks/oeb/polish/fonts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/fonts.py b/src/calibre/ebooks/oeb/polish/fonts.py index 45994ecdcb..4a5a2e4d69 100644 --- a/src/calibre/ebooks/oeb/polish/fonts.py +++ b/src/calibre/ebooks/oeb/polish/fonts.py @@ -91,7 +91,7 @@ def change_font_in_declaration(style, old_name, new_name=None): def remove_embedded_font(container, sheet, rule, sheet_name): - src = getattr(rule.style.getProperty('src'), 'value') + src = getattr(rule.style.getProperty('src'), 'value', None) if src is not None: if src.startswith('url('): src = src[4:-1]