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:
@@ -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))
|
if (ctx!=NULL && duk_has_prop_string(ctx, i, propertyName))
|
||||||
{
|
{
|
||||||
duk_get_prop_string(ctx, i, propertyName);
|
duk_get_prop_string(ctx, i, propertyName);
|
||||||
retVal = duk_to_int(ctx, -1);
|
if (!duk_is_null_or_undefined(ctx, -1))
|
||||||
|
{
|
||||||
|
retVal = duk_to_int(ctx, -1);
|
||||||
|
}
|
||||||
duk_pop(ctx);
|
duk_pop(ctx);
|
||||||
}
|
}
|
||||||
return retVal;
|
return retVal;
|
||||||
|
|||||||
Reference in New Issue
Block a user