Skip to content

Commit

Permalink
only remove elements if they are still there
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed Aug 30, 2024
1 parent 1b07870 commit 5c30568
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nicegui/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ def remove_elements(self, elements: Iterable[Element]) -> None:
element._handle_delete() # pylint: disable=protected-access
element._deleted = True # pylint: disable=protected-access
self.outbox.enqueue_delete(element)
del self.elements[element.id]
if element.id in self.elements:
del self.elements[element.id]

def remove_all_elements(self) -> None:
"""Remove all elements from the client."""
Expand Down

0 comments on commit 5c30568

Please sign in to comment.