src: nullcheck on trace controller · nodejs/node@e0af205 · GitHub
Skip to content

Commit e0af205

Browse files
gireeshpunathiladdaleax
authored andcommitted
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: #25814 PR-URL: #25943 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 1b8d2ca commit e0af205

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/env.cc

Lines changed: 2 additions & 4 deletions

src/node_platform.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ double NodePlatform::CurrentClockTimeMillis() {
459459
}
460460

461461
TracingController* NodePlatform::GetTracingController() {
462+
CHECK_NOT_NULL(tracing_controller_);
462463
return tracing_controller_;
463464
}
464465

src/tracing/agent.h

Lines changed: 3 additions & 1 deletion

0 commit comments

Comments
 (0)