瀏覽代碼

avoid NULL, just in case
(loader might just probably crash anyway)

Gargaj 11 年之前
父節點
當前提交
7925dcadba
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      code/Importer.cpp

+ 5 - 2
code/Importer.cpp

@@ -642,8 +642,11 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags)
 
 		// Get file size for progress handler
 		IOStream * fileIO = pimpl->mIOHandler->Open( pFile );
-		uint32_t fileSize = fileIO->FileSize();
-		pimpl->mIOHandler->Close( fileIO );
+		if (fileIO)
+		{
+			uint32_t fileSize = fileIO->FileSize();
+			pimpl->mIOHandler->Close( fileIO );
+		}
 
 		// Dispatch the reading to the worker class for this format
 		DefaultLogger::get()->info("Found a matching importer for this file format");