Skip to content

Commit

Permalink
Removed nullptr access from Timer().hasStarted() (#1541)
Browse files Browse the repository at this point in the history
  • Loading branch information
kunaltyagi authored and dirk-thomas committed Aug 3, 2020
1 parent c3ebc58 commit e331112
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clients/roscpp/include/ros/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down

0 comments on commit e331112

Please sign in to comment.