diff --git a/nicegui/elements/timer.py b/nicegui/elements/timer.py index ec263f81e..d43880e0c 100644 --- a/nicegui/elements/timer.py +++ b/nicegui/elements/timer.py @@ -126,4 +126,5 @@ def _should_stop(self) -> bool: def _cleanup(self) -> None: self.callback = None assert self.parent_slot - self.parent_slot.parent.remove(self) + if not self.client._deleted: # pylint: disable=protected-access + self.parent_slot.parent.remove(self)