From d72ff712cb70f8345a3eb02a633c790d719da348 Mon Sep 17 00:00:00 2001 From: smalcom Date: Fri, 25 May 2018 21:16:08 +0300 Subject: [PATCH] [F] List of importers can be empty. --- code/Importer.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/code/Importer.cpp b/code/Importer.cpp index 139dc6c51..347ce12d2 100644 --- a/code/Importer.cpp +++ b/code/Importer.cpp @@ -970,15 +970,19 @@ void Importer::GetExtensionList(aiString& szOut) const (*i)->GetExtensionList(str); } - for (std::set::const_iterator it = str.begin();; ) { - szOut.Append("*."); - szOut.Append((*it).c_str()); + // List can be empty + if(str.size() > 0) + { + for (std::set::const_iterator it = str.begin();; ) { + szOut.Append("*."); + szOut.Append((*it).c_str()); - if (++it == str.end()) { - break; - } - szOut.Append(";"); - } + if (++it == str.end()) { + break; + } + szOut.Append(";"); + } + } ASSIMP_END_EXCEPTION_REGION(void); }