mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-03-31 22:32:28 -04:00
Fix #2132137 ['NoneType' object has no attribute 'underlying_book_id'](https://bugs.launchpad.net/calibre/+bug/2132137)
This commit is contained in:
parent
96e3c3458c
commit
9b81dd7090
@ -209,7 +209,7 @@ class StyledItemDelegate(QStyledItemDelegate):
|
||||
|
||||
def createEditor(self, parent, option, index):
|
||||
e = self.create_editor(parent, option, index)
|
||||
if (book_id := index.data(Qt.ItemDataRole.UserRole)) and isinstance(book_id, int):
|
||||
if e is not None and (book_id := index.data(Qt.ItemDataRole.UserRole)) and isinstance(book_id, int):
|
||||
setattr(e, 'underlying_book_id', book_id)
|
||||
return e
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user