From 704fb918c3c36cd3775b14fde172100d5976de1a Mon Sep 17 00:00:00 2001 From: Hikaru Y <47855854+hikaru-y@users.noreply.github.com> Date: Mon, 21 Mar 2022 13:45:22 +0900 Subject: [PATCH] Fix `NotFoundError` when opening browser after switching profiles (#1725) --- qt/aqt/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt/aqt/main.py b/qt/aqt/main.py index 4040a7722..cbcaa0666 100644 --- a/qt/aqt/main.py +++ b/qt/aqt/main.py @@ -279,7 +279,7 @@ class AnkiQt(QMainWindow): def showProfileManager(self) -> None: self.pm.profile = None - self.state = "profileManager" + self.moveToState("profileManager") d = self.profileDiag = self.ProfileManager() f = self.profileForm = aqt.forms.profiles.Ui_MainWindow() f.setupUi(d) @@ -669,7 +669,7 @@ class AnkiQt(QMainWindow): self.clearStateShortcuts() self.state = state gui_hooks.state_will_change(state, oldState) - getattr(self, f"_{state}State")(oldState, *args) + getattr(self, f"_{state}State", lambda *_: None)(oldState, *args) if state != "resetRequired": self.bottomWeb.show() gui_hooks.state_did_change(state, oldState)