Skip to content

Commit

Permalink
Linters and simplify logic
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
  • Loading branch information
Ryanf55 committed Jan 23, 2024
1 parent 5a8edcc commit 5b3af1b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/CameraZoomPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,11 @@ void CameraZoomPlugin::Impl::InitialiseCamera()
if (!this->scene)
{
this->scene = rendering::sceneFromFirstRenderEngine();
if (!this->scene) {
gzerr << "Failed to get scene in InitialiseCamera()!\n";
return;
}

}

// Return if scene not ready or no sensors available.
if (!this->scene->IsInitialized() ||
if (!this->scene ||
!this->scene->IsInitialized() ||
this->scene->SensorCount() == 0)
{
gzwarn << "No scene or camera sensors available.\n";
Expand Down

0 comments on commit 5b3af1b

Please sign in to comment.