Skip to content

Commit b98a775

Browse files
committed
Fix
1 parent c1e1b3c commit b98a775

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

module.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,10 @@ SanitizeForJSON(v8::Isolate *isolate, v8::Local<v8::Context> context,
118118
uint32_t out_index = 0;
119119
for (uint32_t i = 0; i < length; ++i) {
120120
auto maybeEl = arr->Get(context, i);
121-
v8::Local<v8::Value> el =
122-
maybeEl.IsEmpty() ? v8::Undefined(isolate) : maybeEl.ToLocalChecked();
121+
v8::Local<v8::Value> el;
122+
if (!maybeEl.ToLocal(&el)) {
123+
el = v8::Undefined(isolate);
124+
}
123125

124126
auto sanitized = SanitizeForJSON(isolate, context, el, ancestors);
125127
if (!sanitized->IsUndefined()) {

0 commit comments

Comments
 (0)