Skip to content

Commit

Permalink
Ensure ContextSubMenu container is not used when None (Fix kivy#371 and
Browse files Browse the repository at this point in the history
fix kivy#399 (duplicate)).
  • Loading branch information
Poikilos committed May 3, 2024
1 parent 832d971 commit 8377cc4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions designer/uix/contextual.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import logging
logger = logging.getLogger(__name__)

from kivy.clock import Clock
from kivy.lang import Builder
from kivy.metrics import dp
Expand Down Expand Up @@ -488,6 +491,11 @@ def remove_children(self):
'''Clear _list_children[]
'''
for child, index in self._list_children:
if not self.container:
logger.warning(
"container is None in ContextSubMenu remove_children"
)
break
self.container.remove_widget(child)
self._list_children = []

Expand Down

0 comments on commit 8377cc4

Please sign in to comment.