mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-01 08:03:32 +00:00
Updated Duktape_GetBuffer(), so if the object is null or undefined, it returns NULL instead of throwing an exception
This commit is contained in:
@@ -216,6 +216,10 @@ char* Duktape_GetBuffer(duk_context *ctx, duk_idx_t i, duk_size_t *bufLen)
|
||||
duk_json_encode(ctx, i);
|
||||
retVal = (char*)duk_get_lstring(ctx, i, bufLen);
|
||||
}
|
||||
else if (duk_is_null_or_undefined(ctx, i))
|
||||
{
|
||||
retVal = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
ILibDuktape_Error(ctx, "Duktape_GetBuffer(): Unknown parameter");
|
||||
|
||||
Reference in New Issue
Block a user