src: fix nullptr dereference for signal during startup

This fixes a test failure when running
`test/parallel/test-child-process-spawnsync-kill-signal.js`
under load. What would happen is that `SignalExit()` tries
to shutdown the tracing agent, which might not have been set
up by the point that Node.js receives the signal.

PR-URL: https://github.com/nodejs/node/pull/20637
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Anna Henningsen authored and Rod Vagg committed 2018-08-16 11:38:51 +10:00
1 parent 1cb9772a40
commit 8076a793ed
1 file changed
+2 -1
+2 -1
View File
@@ -324,7 +324,8 @@ static struct {
}
void StopTracingAgent() {
tracing_agent_->Stop();
if (tracing_agent_)
tracing_agent_->Stop();
}
NodePlatform* Platform() {