Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion games/game_cyberpunk2077.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class Cyberpunk2077Game(BasicGame):
_redmod_deploy_args = "deploy -reportProgress"
"""Deploy arguments for `redmod.exe`, -modlist=... is added."""

_parentWidget: QWidget
_parentWidget: QWidget | None = None
"""Set with `_organizer.onUserInterfaceInitialized()`"""

def init(self, organizer: mobase.IOrganizer) -> bool:
Expand Down Expand Up @@ -530,6 +530,8 @@ def _onAboutToRun(self, app_path_str: str, wd: QDir, args: str) -> bool:
def _onFinishedRun(self, path: str, exit_code: int) -> None:
if not self._get_setting("crash_message"):
return
if self._parentWidget is None:
return # No main window: MO started from command line or shortcut
if path.endswith(self.binaryName()) and exit_code > 0:
crash_message = QMessageBox(
QMessageBox.Icon.Critical,
Expand Down
Loading