From 51fff497089be54fc8c63c58e96d2162179c50c8 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 6 May 2009 23:40:27 -0500 Subject: [PATCH] find-window: don't bomb if a world has no child. Reported by Joe Groff --- basis/ui/ui.factor | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/basis/ui/ui.factor b/basis/ui/ui.factor index d07403836a..b73de68e26 100644 --- a/basis/ui/ui.factor +++ b/basis/ui/ui.factor @@ -145,7 +145,9 @@ SYMBOL: ui-thread PRIVATE> : find-window ( quot -- world ) - [ windows get values ] dip '[ gadget-child @ ] find-last nip ; inline + [ windows get values ] dip + '[ dup children>> [ ] [ nip first ] if-empty @ ] + find-last nip ; inline : ui-running? ( -- ? ) \ ui-running get-global ;