Work around RuntimeError in _update_button_label() (#3224)

This commit is contained in:
Abdo 2024-06-06 13:19:33 +03:00 committed by GitHub
parent fbb73046e0
commit e3c6b5bf3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -79,7 +79,8 @@ class DeckChooser(QHBoxLayout):
self.selected_deck_id = DEFAULT_DECK_ID
def _update_button_label(self) -> None:
self.deck.setText(self.selected_deck_name().replace("&", "&&"))
if not sip.isdeleted(self.deck):
self.deck.setText(self.selected_deck_name().replace("&", "&&"))
def show(self) -> None:
self._widget.show() # type: ignore