guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: installer: Fix focus-next error handling.


From: Danny Milosavljevic
Subject: 01/01: installer: Fix focus-next error handling.
Date: Sun, 9 Jul 2017 16:49:29 -0400 (EDT)

dannym pushed a commit to branch wip-installer-2
in repository guix.

commit b5bd117b8498d1ea9a65112beb85e1a7204f408d
Author: Danny Milosavljevic <address@hidden>
Date:   Sun Jul 9 22:48:53 2017 +0200

    installer: Fix focus-next error handling.
    
    * gnu/system/installer/page.scm (page-focus-widget-relative): Fix error 
handling.
---
 gnu/system/installer/page.scm | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/gnu/system/installer/page.scm b/gnu/system/installer/page.scm
index a005a3b..1aab0cd 100644
--- a/gnu/system/installer/page.scm
+++ b/gnu/system/installer/page.scm
@@ -103,13 +103,13 @@
 
 (define* (page-focus-widget-relative page direction #:key (buttons? #f) (wrap? 
#f))
   (define (focused-widget-cons widgets)
-    (if widgets
+    (if (null? widgets)
+        '()
         (match (car widgets)
          ((xwidget focused? set-focused!)
           (if (focused? xwidget)
               widgets
-              (focused-widget-cons (cdr widgets)))))
-        '()))
+              (focused-widget-cons (cdr widgets)))))))
   (let* ((menu (page-datum page 'menu))
          (nav  (page-datum page 'navigation))
          (form (page-datum page 'form))
@@ -129,7 +129,7 @@
                                                                 0
                                                                 index)))))))))
          (c (focused-widget-cons widgets))
-         (n (if c (cdr c) '()))
+         (n (if (null? c) '() (cdr c)))
          (next-widget-entry (if (null? n)
                                 (if wrap?
                                     (if (null? widgets)
@@ -137,7 +137,8 @@
                                         (car widgets))
                                     #f)
                                 (car n))))
-    (if c
+    (if (null? c)
+        #f
         (match (car c)
          ((ywidget yfocused? yset-focused!)
           (match direction



reply via email to

[Prev in Thread] Current Thread [Next in Thread]