From 32880e247e2e237a73c2113bdde9134d6c9951f4 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Wed, 30 Mar 2022 12:58:19 -0700 Subject: [PATCH] Avoid nullptr access in MinimalScene (#380) Signed-off-by: Louise Poubel --- src/plugins/minimal_scene/MinimalScene.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/minimal_scene/MinimalScene.cc b/src/plugins/minimal_scene/MinimalScene.cc index 4c9f17fe9..9285ae9f3 100644 --- a/src/plugins/minimal_scene/MinimalScene.cc +++ b/src/plugins/minimal_scene/MinimalScene.cc @@ -559,6 +559,11 @@ std::string IgnRenderer::Initialize() igndbg << "Create scene [" << this->sceneName << "]" << std::endl; auto scene = engine->CreateScene(this->sceneName); + if (nullptr == scene) + { + return "Failed to create scene [" + this->sceneName + "] for engine [" + + this->engineName + "]"; + } scene->SetAmbientLight(this->ambientLight); scene->SetBackgroundColor(this->backgroundColor);