mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-05-24 15:52:32 -04:00
Fix #2132137 ['NoneType' object has no attribute 'underlying_book_id'](https://bugs.launchpad.net/calibre/+bug/2132137)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user