Skip to content

Commit

Permalink
Client: fix failing assert on empty texture name
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed Mar 10, 2024
1 parent f596c36 commit 02a893d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client/texturesource.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 02a893d

Please sign in to comment.