From 6e7aa3d8f421b51ee61efa42f75088e795ae4696 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 21 Feb 2018 15:49:47 +0100 Subject: [PATCH] src: fix abort when taking a heap snapshot Remove an erroneous CHECK that asserted the persistent object's internal field pointer still pointed to a valid object. If ClearWrap() has been called, the field pointer equals nullptr and that is expected behavior. PR-URL: https://github.com/nodejs/node/pull/18898 Fixes: https://github.com/nodejs/node/issues/18256 Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: Ruben Bridgewater Reviewed-By: Anna Henningsen Reviewed-By: Matheus Marchini --- src/async_wrap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/async_wrap.cc b/src/async_wrap.cc index c9dfc40c0ca52d..5e9dc69f87839f 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -128,7 +128,7 @@ RetainedObjectInfo* WrapperInfo(uint16_t class_id, Local wrapper) { CHECK_GT(object->InternalFieldCount(), 0); AsyncWrap* wrap = Unwrap(object); - CHECK_NE(nullptr, wrap); + if (wrap == nullptr) return nullptr; // ClearWrap() already called. return new RetainedAsyncInfo(class_id, wrap); }