From c70e85372343ab445676cf2115f65a4e44f97c94 Mon Sep 17 00:00:00 2001 From: Gireesh Punathil Date: Tue, 5 Feb 2019 00:00:05 -0500 Subject: src: nullcheck on trace controller Insert a NULLCHECK prior to return. Ideally we do this in the caller, but the TraceController object is somewhat special as: 1. It is accessed by most threads 2. It's life cycle is managed by Agent::Agent 3. It's getter is invoked through Base Methods (upstream) Refs: https://github.com/nodejs/node/issues/25814 PR-URL: https://github.com/nodejs/node/pull/25943 Reviewed-By: James M Snell Reviewed-By: Masashi Hirano Reviewed-By: Richard Lau Reviewed-By: Anna Henningsen --- src/tracing/agent.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/tracing') diff --git a/src/tracing/agent.h b/src/tracing/agent.h index d7d67ce2de..2e95e38582 100644 --- a/src/tracing/agent.h +++ b/src/tracing/agent.h @@ -81,7 +81,9 @@ class Agent { ~Agent(); TracingController* GetTracingController() { - return tracing_controller_.get(); + TracingController* controller = tracing_controller_.get(); + CHECK_NOT_NULL(controller); + return controller; } enum UseDefaultCategoryMode { -- cgit v1.2.3