From 02a893d6130a887c51f290b2274adbfd899767df Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sun, 10 Mar 2024 10:50:04 +0100 Subject: [PATCH] Client: fix failing assert on empty texture name --- src/client/texturesource.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/texturesource.cpp b/src/client/texturesource.cpp index 529160b35..6842b08a9 100644 --- a/src/client/texturesource.cpp +++ b/src/client/texturesource.cpp @@ -898,7 +898,9 @@ video::IImage* TextureSource::generateImage(std::string_view name, If this name is enclosed in parentheses, generate it and blit it onto the base image */ - if (last_part_of_name[0] == paren_open + if (last_part_of_name.empty()) { + // keep baseimg == nullptr + } else if (last_part_of_name[0] == paren_open && last_part_of_name.back() == paren_close) { auto name2 = last_part_of_name.substr(1, last_part_of_name.size() - 2);