src: guard against nullptr deref in TimerWrapHandle::Stop

Refs: https://github.com/nodejs/node/pull/34454

PR-URL: https://github.com/nodejs/node/pull/34460
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
This commit is contained in:
Anna Henningsen
2020-07-21 13:27:07 +02:00
parent 3f455cbddb
commit feb93c4e84

View File

@@ -56,7 +56,8 @@ TimerWrapHandle::TimerWrapHandle(
}
void TimerWrapHandle::Stop() {
return timer_->Stop();
if (timer_ != nullptr)
return timer_->Stop();
}
void TimerWrapHandle::Close() {