diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index 96772474fc..c76ca43a37 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -1701,6 +1701,10 @@ class DeviceBooksModel(BooksModel): # {{{ def current_changed(self, current, previous, emit_signal=True): if current.isValid(): idx = current.row() + try: + self.db[self.map[idx]] + except Exception: + return # can happen if the device is ejected try: data = self.get_book_display_info(idx) except Exception: