diff --git a/src/Base/Tools.cpp b/src/Base/Tools.cpp index eee272bd9b..0f65a86a0f 100644 --- a/src/Base/Tools.cpp +++ b/src/Base/Tools.cpp @@ -72,6 +72,10 @@ struct string_comp std::string Base::Tools::getUniqueName(const std::string& name, const std::vector& names, int d) { + if (names.empty()) { + return name; + } + // find highest suffix std::string num_suffix; for (std::vector::const_iterator it = names.begin(); it != names.end(); ++it) {