Fix profile manager used before checked for None (#3272)

* Fix: profile manager used before checked for None

* ./check
This commit is contained in:
Luc Mcgrady 2024-07-10 14:00:15 +01:00 committed by GitHub
parent daf5f68fd5
commit fa4352f3b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -671,11 +671,6 @@ def _run(argv: Optional[list[str]] = None, exec: bool = True) -> Optional[AnkiAp
# we've signaled the primary instance, so we should close # we've signaled the primary instance, so we should close
return None return None
setup_logging(
pm.addon_logs(),
level=logging.DEBUG if int(os.getenv("ANKIDEV", "0")) else logging.INFO,
)
if not pm: if not pm:
if i18n_setup: if i18n_setup:
QMessageBox.critical( QMessageBox.critical(
@ -687,6 +682,11 @@ def _run(argv: Optional[list[str]] = None, exec: bool = True) -> Optional[AnkiAp
QMessageBox.critical(None, "Startup Failed", "Unable to create data folder") QMessageBox.critical(None, "Startup Failed", "Unable to create data folder")
return None return None
setup_logging(
pm.addon_logs(),
level=logging.DEBUG if int(os.getenv("ANKIDEV", "0")) else logging.INFO,
)
# disable icons on mac; this must be done before window created # disable icons on mac; this must be done before window created
if is_mac: if is_mac:
app.setAttribute(Qt.ApplicationAttribute.AA_DontShowIconsInMenus) app.setAttribute(Qt.ApplicationAttribute.AA_DontShowIconsInMenus)