Преглед изворни кода

[F] List of importers can be empty.

smalcom пре 7 година
родитељ
комит
d72ff712cb
1 измењених фајлова са 13 додато и 9 уклоњено
  1. 13 9
      code/Importer.cpp

+ 13 - 9
code/Importer.cpp

@@ -970,15 +970,19 @@ void Importer::GetExtensionList(aiString& szOut) const
         (*i)->GetExtensionList(str);
     }
 
-    for (std::set<std::string>::const_iterator it = str.begin();; ) {
-        szOut.Append("*.");
-        szOut.Append((*it).c_str());
-
-        if (++it == str.end()) {
-            break;
-        }
-        szOut.Append(";");
-    }
+	// List can be empty
+	if(str.size() > 0)
+	{
+		for (std::set<std::string>::const_iterator it = str.begin();; ) {
+			szOut.Append("*.");
+			szOut.Append((*it).c_str());
+
+			if (++it == str.end()) {
+				break;
+			}
+			szOut.Append(";");
+		}
+	}
     ASSIMP_END_EXCEPTION_REGION(void);
 }