diff --git a/es-core/src/utils/FileSystemUtil.cpp b/es-core/src/utils/FileSystemUtil.cpp index f60156c8a..00e20c0b0 100644 --- a/es-core/src/utils/FileSystemUtil.cpp +++ b/es-core/src/utils/FileSystemUtil.cpp @@ -413,9 +413,11 @@ namespace Utils if (fileName == ".") return fileName; - // Find last '.' and erase the extension. - if ((offset = fileName.find_last_of('.')) != std::string::npos) - return fileName.erase(offset); + if (!Utils::FileSystem::isDirectory(_path)) { + // Find last '.' and erase the extension. + if ((offset = fileName.find_last_of('.')) != std::string::npos) + return fileName.erase(offset); + } // No '.' found, filename has no extension. return fileName;