mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Check for mismatched game IDs between held and last games, to prevent a crash with an invalid config.
This commit is contained in:
parent
42b3fba6c0
commit
c959844d54
1 changed files with 7 additions and 1 deletions
|
@ -312,6 +312,13 @@ class Application:
|
|||
except Exception:
|
||||
traceback.print_exc()
|
||||
pass
|
||||
|
||||
# Under normal circumstances, this won't trigger.
|
||||
# But if the config has been incorrectly edited or
|
||||
# otherwise corrupted, this can prevent a crash.
|
||||
if 0 < self.opt.game_holded != self.opt.last_gameid:
|
||||
self.opt.last_gameid = self.opt.game_holded
|
||||
|
||||
# startup information
|
||||
if self.getGameClass(self.opt.last_gameid):
|
||||
self.nextgame.id = self.opt.last_gameid
|
||||
|
@ -346,7 +353,6 @@ class Application:
|
|||
self.opt.game_holded = 0
|
||||
tmpgame.destruct()
|
||||
destruct(tmpgame)
|
||||
tmpgame = None
|
||||
#
|
||||
# widgets
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue