diff --git a/src/boot/boot.janet b/src/boot/boot.janet index 98fcb2fa..9da0724c 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -1381,7 +1381,7 @@ a sequence of keys.` [ds ks &opt dflt] (var d ds) - (loop [k :in ks :while d] (set d (get d k))) + (loop [k :in ks :while (not (nil? d))] (set d (get d k))) (if (= nil d) dflt d)) (defn update-in diff --git a/test/suite0010.janet b/test/suite0010.janet index 7e8c8520..db2c7ead 100644 --- a/test/suite0010.janet +++ b/test/suite0010.janet @@ -161,4 +161,10 @@ ([err] :caught)))) "regression #638")) +# Issue #751 +(def t {:side false}) +(assert (nil? (get-in t [:side :note])) "get-in with false value") +(assert (= (get-in t [:side :note] "dflt") "dflt") + "get-in with false value and default") + (end-suite)