-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add protection for nulltpr crash in CameraZoomPlugin #79
Add protection for nulltpr crash in CameraZoomPlugin #79
Conversation
966cfe1
to
5a8edcc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor style change and question if we can re-use existing check block?
src/CameraZoomPlugin.cc
Outdated
if (!this->scene) | ||
{ | ||
this->scene = rendering::sceneFromFirstRenderEngine(); | ||
if (!this->scene) { | ||
gzerr << "Failed to get scene in InitialiseCamera()!\n"; | ||
return; | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add the !this->scene check to the block that checks for initialisation?
if (this->scene == nullptr ||
!this->scene->IsInitialized() ||
this->scene->SensorCount() == 0)
{
5b3af1b
to
7f876a1
Compare
@Ryanf55 - changed base to |
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
7f876a1
to
071163e
Compare
Fixes #77
Make sure to hit Play in gazebo for the image topic to show up!