1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-17 00:33:33 +00:00

Updated GetIntProperty to treat null/undefined as non-existant

This commit is contained in:
Bryan Roe
2019-12-09 15:03:58 -08:00
parent 0e3280a5da
commit 29bd710972

View File

@@ -150,7 +150,10 @@ int Duktape_GetIntPropertyValue(duk_context *ctx, duk_idx_t i, char* propertyNam
if (ctx!=NULL && duk_has_prop_string(ctx, i, propertyName))
{
duk_get_prop_string(ctx, i, propertyName);
if (!duk_is_null_or_undefined(ctx, -1))
{
retVal = duk_to_int(ctx, -1);
}
duk_pop(ctx);
}
return retVal;