diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2017-06-24 22:50:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-06-26 06:41:44 +0300 |
commit | fb96228441d98f9af5d8d7361359a54c9b554967 (patch) | |
tree | 052e59c8b55237edde27be7ee41498623972f06a /source/blender/collada | |
parent | 0a79b350b5a7b5af13a28a399bf31602f759d2ac (diff) |
Collada: improved Error handling: Avoid shutdown of Blender when the Collada importer finds Syntax errors in import data
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/ErrorHandler.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/collada/ErrorHandler.cpp b/source/blender/collada/ErrorHandler.cpp index 98aa85f8a9b..32aa5636e08 100644 --- a/source/blender/collada/ErrorHandler.cpp +++ b/source/blender/collada/ErrorHandler.cpp @@ -49,7 +49,7 @@ ErrorHandler::~ErrorHandler() //-------------------------------------------------------------------- bool ErrorHandler::handleError(const COLLADASaxFWL::IError *error) { - bool isError = true; + bool isError = false; if (error->getErrorClass() == COLLADASaxFWL::IError::ERROR_SAXPARSER) { COLLADASaxFWL::SaxParserError *saxParserError = (COLLADASaxFWL::SaxParserError *) error; @@ -81,10 +81,7 @@ bool ErrorHandler::handleError(const COLLADASaxFWL::IError *error) * Accept non critical errors as warnings (i.e. texture not found) * This makes the importer more graceful, so it now imports what makes sense. */ - if (saxFWLError->getSeverity() == COLLADASaxFWL::IError::SEVERITY_ERROR_NONCRITICAL) { - isError = false; - } - + isError = (saxFWLError->getSeverity() != COLLADASaxFWL::IError::SEVERITY_ERROR_NONCRITICAL); std::cout << "Sax FWL Error: " << saxFWLError->getErrorMessage() << std::endl; } else { @@ -93,5 +90,5 @@ bool ErrorHandler::handleError(const COLLADASaxFWL::IError *error) mError |= isError; - return false; // let OpenCollada decide when to abort + return isError; // let OpenCollada decide when to abort } |