From aa227fc7f8a5571ca3307255a93f0804a174c5b1 Mon Sep 17 00:00:00 2001 From: Oldes Date: Sun, 24 Dec 2023 13:08:42 +0100 Subject: [PATCH] FIX: avoid an error when loading an unset value --- src/mezz/sys-load.reb | 2 +- src/tests/units/load-test.r3 | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mezz/sys-load.reb b/src/mezz/sys-load.reb index 324bc461cd..69c269e255 100644 --- a/src/mezz/sys-load.reb +++ b/src/mezz/sys-load.reb @@ -354,7 +354,7 @@ load: function [ header empty? data 1 < length? data - ][data: first data] + ][set/any 'data first data] ] :data ] diff --git a/src/tests/units/load-test.r3 b/src/tests/units/load-test.r3 index c963388a89..bf51ac2e0b 100644 --- a/src/tests/units/load-test.r3 +++ b/src/tests/units/load-test.r3 @@ -103,6 +103,9 @@ Rebol [ e/near = "(line 4) 4line" ] + --test-- "loading an unset value" + --assert unset? try [load "#[unset]"] ;- no error + ===end-group=== ===start-group=== "find-script native"