Browse Source

Fix review findings

Kim Kulling 4 years ago
parent
commit
a34b9d1c95
1 changed files with 7 additions and 6 deletions
  1. 7 6
      code/PostProcessing/EmbedTexturesProcess.cpp

+ 7 - 6
code/PostProcessing/EmbedTexturesProcess.cpp

@@ -4,7 +4,6 @@ Open Asset Import Library (assimp)
 
 
 Copyright (c) 2006-2021, assimp team
 Copyright (c) 2006-2021, assimp team
 
 
-
 All rights reserved.
 All rights reserved.
 
 
 Redistribution and use of this software in source and binary forms,
 Redistribution and use of this software in source and binary forms,
@@ -50,11 +49,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 using namespace Assimp;
 using namespace Assimp;
 
 
-EmbedTexturesProcess::EmbedTexturesProcess()
-: BaseProcess() {
+EmbedTexturesProcess::EmbedTexturesProcess() :
+        BaseProcess() {
+    // empty
 }
 }
 
 
 EmbedTexturesProcess::~EmbedTexturesProcess() {
 EmbedTexturesProcess::~EmbedTexturesProcess() {
+    // empty
 }
 }
 
 
 bool EmbedTexturesProcess::IsActive(unsigned int pFlags) const {
 bool EmbedTexturesProcess::IsActive(unsigned int pFlags) const {
@@ -68,12 +69,12 @@ void EmbedTexturesProcess::SetupProperties(const Importer* pImp) {
 }
 }
 
 
 void EmbedTexturesProcess::Execute(aiScene* pScene) {
 void EmbedTexturesProcess::Execute(aiScene* pScene) {
-    if (pScene == nullptr || pScene->mRootNode == nullptr) return;
+    if (pScene == nullptr || pScene->mRootNode == nullptr || mIOHandler == nullptr){
+        return;
+    }
 
 
     aiString path;
     aiString path;
-
     uint32_t embeddedTexturesCount = 0u;
     uint32_t embeddedTexturesCount = 0u;
-
     for (auto matId = 0u; matId < pScene->mNumMaterials; ++matId) {
     for (auto matId = 0u; matId < pScene->mNumMaterials; ++matId) {
         auto material = pScene->mMaterials[matId];
         auto material = pScene->mMaterials[matId];