Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/env.cc6
-rw-r--r--src/node_platform.cc1
-rw-r--r--src/tracing/agent.h4
3 files changed, 6 insertions, 5 deletions
diff --git a/src/env.cc b/src/env.cc
index d099a9e62ad..2e0fa251b35 100644
--- a/src/env.cc
+++ b/src/env.cc
@@ -208,8 +208,7 @@ Environment::Environment(IsolateData* isolate_data,
if (tracing::AgentWriterHandle* writer = GetTracingAgentWriter()) {
trace_state_observer_ = std::make_unique<TrackingTraceStateObserver>(this);
TracingController* tracing_controller = writer->GetTracingController();
- if (tracing_controller != nullptr)
- tracing_controller->AddTraceStateObserver(trace_state_observer_.get());
+ tracing_controller->AddTraceStateObserver(trace_state_observer_.get());
}
destroy_async_id_list_.reserve(512);
@@ -272,8 +271,7 @@ Environment::~Environment() {
tracing::AgentWriterHandle* writer = GetTracingAgentWriter();
CHECK_NOT_NULL(writer);
TracingController* tracing_controller = writer->GetTracingController();
- if (tracing_controller != nullptr)
- tracing_controller->RemoveTraceStateObserver(trace_state_observer_.get());
+ tracing_controller->RemoveTraceStateObserver(trace_state_observer_.get());
}
delete[] heap_statistics_buffer_;
diff --git a/src/node_platform.cc b/src/node_platform.cc
index b930edb156b..139e2ebfc1f 100644
--- a/src/node_platform.cc
+++ b/src/node_platform.cc
@@ -459,6 +459,7 @@ double NodePlatform::CurrentClockTimeMillis() {
}
TracingController* NodePlatform::GetTracingController() {
+ CHECK_NOT_NULL(tracing_controller_);
return tracing_controller_;
}
diff --git a/src/tracing/agent.h b/src/tracing/agent.h
index d7d67ce2de6..2e95e38582f 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 {