From 42b4f3ce0b3411ecdc5c362d199b25a7ffb3f609 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 61fd40a486b3bd..b1212e97704ef0 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -129,7 +129,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); }