Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7acfacb

Browse filesBrowse files
cjihrigtargos
authored andcommitted
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: #21545 Fixes: #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>
1 parent 45fe865 commit 7acfacb
Copy full SHA for 7acfacb

File tree

Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed
Open diff view settings
Collapse file

‎src/node_trace_events.cc‎

Copy file name to clipboardExpand all lines: src/node_trace_events.cc
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ static std::unordered_set<std::string> categoryGroups;
9595
// Gets a pointer to the category-enabled flags for a tracing category group,
9696
// if tracing is enabled for it.
9797
static const uint8_t* GetCategoryGroupEnabled(const char* category_group) {
98-
if (category_group == nullptr) return nullptr;
99-
100-
return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group);
98+
CHECK_NOT_NULL(category_group);
99+
return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group);
101100
}
102101

103102
static const char* GetCategoryGroup(Environment* env,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.