From e331112302508b498a96ec3612f8255d11337d5f Mon Sep 17 00:00:00 2001 From: Kunal Tyagi Date: Thu, 3 Jan 2019 06:55:14 +0900 Subject: [PATCH] Removed nullptr access from Timer().hasStarted() (#1541) --- clients/roscpp/include/ros/timer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/roscpp/include/ros/timer.h b/clients/roscpp/include/ros/timer.h index 2d5663e443..92f089cb23 100644 --- a/clients/roscpp/include/ros/timer.h +++ b/clients/roscpp/include/ros/timer.h @@ -71,7 +71,7 @@ class ROSCPP_DECL Timer */ void setPeriod(const Duration& period, bool reset=true); - bool hasStarted() const { return impl_->hasStarted(); } + bool hasStarted() const { return impl_ && impl_->hasStarted(); } bool isValid() { return impl_ && impl_->isValid(); } operator void*() { return isValid() ? (void*)1 : (void*)0; }