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; }