From c40ce7528f015965545a1e77d803626ab066d75f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 27 Mar 2021 16:14:32 +0800 Subject: [PATCH] bugfix --- kivyblocks/blocks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kivyblocks/blocks.py b/kivyblocks/blocks.py index 801a38b..c44e18b 100755 --- a/kivyblocks/blocks.py +++ b/kivyblocks/blocks.py @@ -668,8 +668,10 @@ class Blocks(EventDispatcher): 'widget=', from_widget) if isinstance(from_widget, WindowBase): return None - return find_widget_by_id(id, - from_widget=from_widget.parent) + if from_widget.parent: + return find_widget_by_id(id, + from_widget=from_widget.parent) + return None else: for c in from_widget.children: ret = find_widget_by_id(id,from_widget=c)