From e46bad291ebd7412d2bbfacc0fe5a141a2fcdbf9 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Sun, 25 Mar 2018 03:22:25 +0200 Subject: [PATCH] Fixed scopes --- src/main.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index b1e4fc0..8c1b771 100644 --- a/src/main.cc +++ b/src/main.cc @@ -72,6 +72,8 @@ static bool construct_parent_block(const cryptonote::block& b, cryptonote::block } NAN_METHOD(convert_blob) { + NanScope(); + if (info.Length() < 1) return THROW_ERROR_EXCEPTION("You must provide one argument."); Local target = info[0]->ToObject(); @@ -97,6 +99,8 @@ NAN_METHOD(convert_blob) { } NAN_METHOD(get_block_id) { + NanScope(); + if (info.Length() < 1) return THROW_ERROR_EXCEPTION("You must provide one argument."); Local target = info[0]->ToObject(); @@ -116,6 +120,8 @@ NAN_METHOD(get_block_id) { } NAN_METHOD(construct_block_blob) { + NanScope(); + if (info.Length() < 2) return THROW_ERROR_EXCEPTION("You must provide two arguments."); Local block_template_buf = info[0]->ToObject(); @@ -146,8 +152,9 @@ NAN_METHOD(construct_block_blob) { NanReturnValue(NanNewBufferHandle(output.data(), output.size())); } - NAN_METHOD(address_decode) { + NanEscapableScope(); + if (info.Length() < 1) return THROW_ERROR_EXCEPTION("You must provide one argument."); Local target = info[0]->ToObject(); @@ -171,6 +178,8 @@ NAN_METHOD(address_decode) { } NAN_METHOD(address_decode_integrated) { + NanEscapableScope(); + if (info.Length() < 1) return THROW_ERROR_EXCEPTION("You must provide one argument."); Local target = info[0]->ToObject();