async_hooks: CHECK that resource is not empty

This condition can be triggered through the public C++ embedder API.

PR-URL: https://github.com/nodejs/node/pull/14694
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit is contained in:
Anna Henningsen 2017-08-08 18:41:19 +02:00
parent 1419533df9
commit 66fd78e39d
No known key found for this signature in database
GPG Key ID: D8B9F5AEAE84E4CF

View File

@ -645,6 +645,8 @@ void AsyncWrap::EmitAsyncInit(Environment* env,
Local<String> type,
double async_id,
double trigger_id) {
CHECK(!object.IsEmpty());
CHECK(!type.IsEmpty());
AsyncHooks* async_hooks = env->async_hooks();
// Nothing to execute, so can continue normally.