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 <[email protected]>
  • Loading branch information
Ryanf55 authored and srmainwaring committed Jan 25, 2024
1 parent 861f752 commit e0cf84c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/CameraZoomPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,23 +165,20 @@ void CameraZoomPlugin::Impl::OnZoom(const msgs::Double &_msg)
void CameraZoomPlugin::Impl::InitialiseCamera()
{
// Wait for render engine to be available.
if (rendering::loadedEngines().empty()) {
if (rendering::loadedEngines().empty())
{
return;
}

// Get scene.
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 == nullptr ||
!this->scene->IsInitialized() ||
this->scene->SensorCount() == 0)
{
gzwarn << "No scene or camera sensors available.\n";
Expand Down

0 comments on commit e0cf84c

Please sign in to comment.