Skip to content

Commit

Permalink
src: fix useless call in permission.cc
Browse files Browse the repository at this point in the history
FromMaybe() has no side effects and the return value is ignored. Use
Check() instead to ensure that the operation succeeded.
  • Loading branch information
tniessen committed Feb 25, 2023
1 parent 347215e commit 5989869
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/permission/permission.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ void Permission::ThrowAccessDenied(Environment* env,
PermissionToString(perm),
v8::NewStringType::kNormal)
.ToLocalChecked())
.FromMaybe(false);
.Check();
err.As<Object>()
->Set(env->context(),
env->resource_string(),
v8::String::NewFromUtf8(env->isolate(),
std::string(res).c_str(),
v8::NewStringType::kNormal)
.ToLocalChecked())
.FromMaybe(false);
.Check();
env->isolate()->ThrowException(err);
}

Expand Down

0 comments on commit 5989869

Please sign in to comment.