diff --git a/pysollib/game/__init__.py b/pysollib/game/__init__.py index c2d6e9e90..4acbda272 100644 --- a/pysollib/game/__init__.py +++ b/pysollib/game/__init__.py @@ -2274,8 +2274,9 @@ def _autoPlay(self, autofaceup, autodrop, autodeal, sound): self.finishMove() if self.checkForWin(): return 1 - self.top.update_idletasks() - self.top.busyUpdate() + if self.top is not None: + self.top.update_idletasks() + self.top.busyUpdate() return 0 def _autoDeal(self, sound=True): diff --git a/pysollib/stack.py b/pysollib/stack.py index 71abfb87e..f15efb0ef 100644 --- a/pysollib/stack.py +++ b/pysollib/stack.py @@ -1689,7 +1689,7 @@ def dealToStacks(self, stacks, flip=1, reverse=0, frames=-1): if flip: self.game.flipMove(self) self.game.moveMove(1, self, r, frames=frames) - if frames > 0: + if frames > 0 and self.game.top is not None: self.game.top.update_idletasks() self.game.top.busyUpdate() self.game.leaveState(old_state)