Skip to content

Commit

Permalink
Check for nullptr in WallTimer::hasStarted() and SteadyTimer::hasStar…
Browse files Browse the repository at this point in the history
…ted()

Analogous to fe9479c (ros#1541).
  • Loading branch information
meyerj committed Jan 31, 2019
1 parent 7db0fbf commit 721d683
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clients/roscpp/include/ros/steady_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ROSCPP_DECL SteadyTimer
*/
void setPeriod(const WallDuration& 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; }

Expand Down
2 changes: 1 addition & 1 deletion clients/roscpp/include/ros/wall_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ROSCPP_DECL WallTimer
*/
void setPeriod(const WallDuration& 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; }

Expand Down

0 comments on commit 721d683

Please sign in to comment.