From 07701fa7aa1f6381aa29fcbef00c71054c3117a5 Mon Sep 17 00:00:00 2001 From: Robo Date: Thu, 19 Nov 2020 03:58:12 -0800 Subject: [PATCH] fix: add missing handlescope (#332) --- src/async.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/async.cc b/src/async.cc index 20dd9c3c..aef449ad 100644 --- a/src/async.cc +++ b/src/async.cc @@ -36,10 +36,12 @@ void SetPasswordWorker::Execute() { } void SetPasswordWorker::OnOK() { + Napi::HandleScope scope(Env()); deferred.Resolve(Env().Undefined()); } void SetPasswordWorker::OnError(Napi::Error const &error) { + Napi::HandleScope scope(Env()); deferred.Reject(error.Value()); } @@ -75,6 +77,7 @@ void GetPasswordWorker::Execute() { } void GetPasswordWorker::OnOK() { + Napi::HandleScope scope(Env()); Napi::Value val = Env().Null(); if (success) { val = Napi::String::New(Env(), password.data(), @@ -84,6 +87,7 @@ void GetPasswordWorker::OnOK() { } void GetPasswordWorker::OnError(Napi::Error const &error) { + Napi::HandleScope scope(Env()); deferred.Reject(error.Value()); } @@ -115,10 +119,12 @@ void DeletePasswordWorker::Execute() { } void DeletePasswordWorker::OnOK() { + Napi::HandleScope scope(Env()); deferred.Resolve(Napi::Boolean::New(Env(), success)); } void DeletePasswordWorker::OnError(Napi::Error const &error) { + Napi::HandleScope scope(Env()); deferred.Reject(error.Value()); } @@ -150,6 +156,7 @@ void FindPasswordWorker::Execute() { } void FindPasswordWorker::OnOK() { + Napi::HandleScope scope(Env()); Napi::Value val = Env().Null(); if (success) { val = Napi::String::New(Env(), password.data(), @@ -159,6 +166,7 @@ void FindPasswordWorker::OnOK() { } void FindPasswordWorker::OnError(Napi::Error const &error) { + Napi::HandleScope scope(Env()); deferred.Reject(error.Value()); } @@ -190,6 +198,7 @@ void FindCredentialsWorker::Execute() { } void FindCredentialsWorker::OnOK() { + Napi::HandleScope scope(Env()); Napi::Env env = Env(); if (success) { @@ -228,5 +237,6 @@ void FindCredentialsWorker::OnOK() { } void FindCredentialsWorker::OnError(Napi::Error const &error) { + Napi::HandleScope scope(Env()); deferred.Reject(error.Value()); }