1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 19:19:53 +00:00

Fix symbol lookup when symbol isn't found.

This commit is contained in:
Calvin Rose 2022-06-06 10:53:00 -05:00
parent 8d1ad99f42
commit 74348ab6c2

View File

@ -374,6 +374,7 @@ JANET_CORE_FN(janet_core_native_lookup,
JanetAbstractNative *anative = janet_getabstract(argv, 0, &janet_native_type); JanetAbstractNative *anative = janet_getabstract(argv, 0, &janet_native_type);
const char *sym = janet_getcstring(argv, 1); const char *sym = janet_getcstring(argv, 1);
void *value = symbol_clib(anative->clib, sym); void *value = symbol_clib(anative->clib, sym);
if (NULL == value) return janet_wrap_nil();
return janet_wrap_pointer(value); return janet_wrap_pointer(value);
} }