mirror of
https://github.com/minetest/minetest.git
synced 2025-03-14 14:22:36 +01:00
Fix getDimension throwing error if there is \r at end of line (#15299)
This commit is contained in:
@ -721,7 +721,7 @@ core::dimension2d<u32> CGUITTFont::getDimension(const std::u32string& text) cons
|
||||
if (p == '\r') // Mac or Windows line breaks.
|
||||
{
|
||||
lineBreak = true;
|
||||
if (*(iter + 1) == '\n')
|
||||
if (iter + 1 != text.end() && *(iter + 1) == '\n')
|
||||
{
|
||||
++iter;
|
||||
p = *iter;
|
||||
|
Reference in New Issue
Block a user