From 645c58e5145027be710ebbec4c4a4a5530f4d1f6 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 2 May 2024 02:06:10 +0500 Subject: upd: return empty string if vec is empty --- src/utils/string.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/utils/string.cpp b/src/utils/string.cpp index 8a4c1cc..9727f3f 100644 --- a/src/utils/string.cpp +++ b/src/utils/string.cpp @@ -1,5 +1,6 @@ #include "string.hpp" +#include #include #include #include @@ -23,6 +24,10 @@ namespace bot { std::string join_vector(const std::vector &vec, char delimiter) { + if (vec.empty()) { + return ""; + } + std::string str; for (auto i = vec.begin(); i != vec.end() - 1; i++) { -- cgit v1.2.3