diff options
author | cjihrig <cjihrig@gmail.com> | 2018-06-26 10:16:20 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2018-06-28 11:51:33 -0400 |
commit | 2a875c3c6ffd5e7023d22990a4ba8e90c4cc1307 (patch) | |
tree | fd12e986b278d0cfe93ea108c20d30b9aa020700 /src/node_trace_events.cc | |
parent | 026d279acae0c11d9767f6f5a7b57a945257e53c (diff) | |
download | android-node-v8-2a875c3c6ffd5e7023d22990a4ba8e90c4cc1307.tar.gz android-node-v8-2a875c3c6ffd5e7023d22990a4ba8e90c4cc1307.tar.bz2 android-node-v8-2a875c3c6ffd5e7023d22990a4ba8e90c4cc1307.zip |
src: add null check to GetCategoryGroupEnabled()
The input to this function shouldn't be null, and callers are
not equipped to deal with a nullptr return value. Change the
nullptr return to a CHECK_NOT_NULL(). Also fix the indentation
of the function.
PR-URL: https://github.com/nodejs/node/pull/21545
Fixes: https://github.com/nodejs/node/issues/19991
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'src/node_trace_events.cc')
-rw-r--r-- | src/node_trace_events.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc index 13a3dbce1b..985c706dc4 100644 --- a/src/node_trace_events.cc +++ b/src/node_trace_events.cc @@ -95,9 +95,8 @@ static std::unordered_set<std::string> categoryGroups; // Gets a pointer to the category-enabled flags for a tracing category group, // if tracing is enabled for it. static const uint8_t* GetCategoryGroupEnabled(const char* category_group) { - if (category_group == nullptr) return nullptr; - - return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group); + CHECK_NOT_NULL(category_group); + return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group); } static const char* GetCategoryGroup(Environment* env, |