check tag string size before access

This commit is contained in:
a 2024-11-26 23:15:04 +02:00
parent d8e94a373a
commit e93dfc22b1

View File

@ -381,7 +381,7 @@ std::optional<std::string> Steam_UGC::get_query_ugc_tag(UGCQueryHandle_t handle,
if (indexTag >= res.size()) return std::nullopt;
std::string tmp = res[indexTag];
if (tmp.back() == ',') {
if (!tmp.empty() && tmp.back() == ',') {
tmp = tmp.substr(0, tmp.size() - 1);
}
return tmp;