Skip to content

Commit ae78b3b

Browse files
committed
ESP32/NVS: return namespace_not_found as undefined in get function
namespace not found is quite common in a newly flash device, for consistency reasons it should be returned as undefined. Signed-off-by: Davide Bettio <[email protected]>
1 parent abb9ea2 commit ae78b3b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libs/eavmlib/src/esp.erl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ nvs_get_binary(Namespace, Key) when is_atom(Namespace) andalso is_atom(Key) ->
180180
case esp:nvs_fetch_binary(Namespace, Key) of
181181
{ok, Result} -> Result;
182182
{error, not_found} -> undefined;
183+
{error, namespace_not_found} -> undefined;
183184
{error, OtherError} -> throw(OtherError)
184185
end.
185186

0 commit comments

Comments
 (0)