Skip to content

Commit 32ff10c

Browse files
indutnyguybedford
authored andcommitted
src: move CHECK in AddIsolateFinishedCallback
`CHECK(it->second)` asserts that we have `PerIsolatePlatformData` in the `per_isolate_` map, and not just a key with empty value. When `it == per_isolate_.end()`, however, it means that we don't have the isolate and the `CHECK(it->second)` is guaranteed to fail then! PR-URL: #38010 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 4a85a4b commit 32ff10c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_platform.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,10 @@ void NodePlatform::AddIsolateFinishedCallback(Isolate* isolate,
359359
Mutex::ScopedLock lock(per_isolate_mutex_);
360360
auto it = per_isolate_.find(isolate);
361361
if (it == per_isolate_.end()) {
362-
CHECK(it->second);
363362
cb(data);
364363
return;
365364
}
365+
CHECK(it->second);
366366
it->second->AddShutdownCallback(cb, data);
367367
}
368368

0 commit comments

Comments
 (0)