Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 07701fa

Browse files
authored
fix: add missing handlescope (#332)
1 parent 74f472b commit 07701fa

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/async.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ void SetPasswordWorker::Execute() {
3636
}
3737

3838
void SetPasswordWorker::OnOK() {
39+
Napi::HandleScope scope(Env());
3940
deferred.Resolve(Env().Undefined());
4041
}
4142

4243
void SetPasswordWorker::OnError(Napi::Error const &error) {
44+
Napi::HandleScope scope(Env());
4345
deferred.Reject(error.Value());
4446
}
4547

@@ -75,6 +77,7 @@ void GetPasswordWorker::Execute() {
7577
}
7678

7779
void GetPasswordWorker::OnOK() {
80+
Napi::HandleScope scope(Env());
7881
Napi::Value val = Env().Null();
7982
if (success) {
8083
val = Napi::String::New(Env(), password.data(),
@@ -84,6 +87,7 @@ void GetPasswordWorker::OnOK() {
8487
}
8588

8689
void GetPasswordWorker::OnError(Napi::Error const &error) {
90+
Napi::HandleScope scope(Env());
8791
deferred.Reject(error.Value());
8892
}
8993

@@ -115,10 +119,12 @@ void DeletePasswordWorker::Execute() {
115119
}
116120

117121
void DeletePasswordWorker::OnOK() {
122+
Napi::HandleScope scope(Env());
118123
deferred.Resolve(Napi::Boolean::New(Env(), success));
119124
}
120125

121126
void DeletePasswordWorker::OnError(Napi::Error const &error) {
127+
Napi::HandleScope scope(Env());
122128
deferred.Reject(error.Value());
123129
}
124130

@@ -150,6 +156,7 @@ void FindPasswordWorker::Execute() {
150156
}
151157

152158
void FindPasswordWorker::OnOK() {
159+
Napi::HandleScope scope(Env());
153160
Napi::Value val = Env().Null();
154161
if (success) {
155162
val = Napi::String::New(Env(), password.data(),
@@ -159,6 +166,7 @@ void FindPasswordWorker::OnOK() {
159166
}
160167

161168
void FindPasswordWorker::OnError(Napi::Error const &error) {
169+
Napi::HandleScope scope(Env());
162170
deferred.Reject(error.Value());
163171
}
164172

@@ -190,6 +198,7 @@ void FindCredentialsWorker::Execute() {
190198
}
191199

192200
void FindCredentialsWorker::OnOK() {
201+
Napi::HandleScope scope(Env());
193202
Napi::Env env = Env();
194203

195204
if (success) {
@@ -228,5 +237,6 @@ void FindCredentialsWorker::OnOK() {
228237
}
229238

230239
void FindCredentialsWorker::OnError(Napi::Error const &error) {
240+
Napi::HandleScope scope(Env());
231241
deferred.Reject(error.Value());
232242
}

0 commit comments

Comments
 (0)