Skip to content

Commit

Permalink
GRAPHICS: MACGUI: Added sanity check to splitString()
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Jan 14, 2020
1 parent bd30315 commit 66455b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion graphics/macgui/mactext.cpp
Expand Up @@ -279,7 +279,10 @@ void MacText::splitString(Common::U32String &str) {

_currentFormatting.getFont()->wordWrapText(tmp, _maxWidth, text, w);

_textLines[curLine].chunks[curChunk].text = text[0];
if (text.size())
_textLines[curLine].chunks[curChunk].text = text[0];
else
warning("MacText::splitString(): Font resulted in 0 width for text '%s'", tmp.encode().c_str());

if (text.size() > 1) {
for (uint i = 1; i < text.size(); i++) {
Expand Down

0 comments on commit 66455b6

Please sign in to comment.