Browse Source

Bugfix: Fix a crash when scene picking an object with a not-yet-loaded material

BearishSun 6 năm trước cách đây
mục cha
commit
dcfa98ad44
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      Source/EditorCore/Scene/BsScenePicking.cpp

+ 1 - 1
Source/EditorCore/Scene/BsScenePicking.cpp

@@ -130,7 +130,7 @@ namespace bs
 						SPtr<RasterizerState> rasterizerState = RasterizerState::getDefault();
 
 						HMaterial originalMat = renderable->getMaterial(i);
-						if (originalMat != nullptr && originalMat->getNumPasses() > 0)
+						if (originalMat.isLoaded() && originalMat->getNumPasses() > 0)
 						{
 							SPtr<Pass> firstPass = originalMat->getPass(0); // Note: We only ever check the first pass, problem?
 							const auto& pipelineState = firstPass->getGraphicsPipelineState();