Skip to content

Commit

Permalink
bugfix: finalizer throws
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Rogg committed Feb 7, 2019
1 parent dd0893f commit cb85fb8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/low_crypto.cpp
Expand Up @@ -72,7 +72,9 @@ duk_ret_t low_crypto_hash_finalizer(duk_context *ctx)
{
low_main_t *low = duk_get_low_context(ctx);

int index = duk_require_int(ctx, 0);
duk_get_prop_string(ctx, 0, "_native");
int index = duk_require_int(ctx, -1);

if(index < 0 || index >= low->cryptoHashes.size())
duk_reference_error(ctx, "crypto hash not found");

Expand Down

0 comments on commit cb85fb8

Please sign in to comment.