]> gitweb.factorcode.org Git - factor.git/commitdiff
find-window: don't bomb if a world has no child. Reported by Joe Groff
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 7 May 2009 04:40:27 +0000 (23:40 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 7 May 2009 04:40:27 +0000 (23:40 -0500)
basis/ui/ui.factor

index d07403836a2ba5cc02238ad5fffc9894be59fe67..b73de68e265be5b95927570e71e9d84fd6b9aab3 100644 (file)
@@ -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 ;