From 7925dcadba2778d8e8a4308aacf252ef19ace689 Mon Sep 17 00:00:00 2001 From: Gargaj Date: Thu, 7 Aug 2014 08:25:10 +0200 Subject: [PATCH] avoid NULL, just in case (loader might just probably crash anyway) --- code/Importer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/Importer.cpp b/code/Importer.cpp index 9cfb5be46..c22b76057 100644 --- a/code/Importer.cpp +++ b/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");