From 9d2a9ed9d9d8c0e3abd09f456db3b3b03673ed57 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 19 Aug 2022 17:03:55 +0200 Subject: [PATCH] Fixed an issue where StringUtil::delimitedStringToVector could return empty elements. --- es-core/src/utils/StringUtil.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/es-core/src/utils/StringUtil.cpp b/es-core/src/utils/StringUtil.cpp index 0fabe865e..281c0f5c1 100644 --- a/es-core/src/utils/StringUtil.cpp +++ b/es-core/src/utils/StringUtil.cpp @@ -706,6 +706,10 @@ namespace Utils std::sort(vectorResult.begin(), vectorResult.end()); } + // Remove any empty elements. + vectorResult.erase(remove(vectorResult.begin(), vectorResult.end(), ""), + vectorResult.end()); + return vectorResult; }