From 22419901c91abab2f756b075a90261b31c0cad7a Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Wed, 16 Mar 2022 11:27:02 -0700 Subject: [PATCH] Fix crash on material switcher when there are points Signed-off-by: Louise Poubel --- ogre2/src/Ogre2MaterialSwitcher.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogre2/src/Ogre2MaterialSwitcher.cc b/ogre2/src/Ogre2MaterialSwitcher.cc index bcf9bf123..fdbadb2b3 100644 --- a/ogre2/src/Ogre2MaterialSwitcher.cc +++ b/ogre2/src/Ogre2MaterialSwitcher.cc @@ -106,7 +106,7 @@ void Ogre2MaterialSwitcher::cameraPreRenderScene( auto material = Ogre::MaterialManager::getSingleton().getByName( subItem->getMaterial()->getName() + "_solid", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); - if (material->getNumSupportedTechniques() > 0u) + if (material && material->getNumSupportedTechniques() > 0u) { subItem->setMaterial(material); }