2
0
Эх сурвалжийг харах

Small crash fix

Crash fix when font isn't set.
Nathan Bowhay 10 жил өмнө
parent
commit
d0972c9be1

+ 2 - 0
Engine/source/gui/core/guiControl.cpp

@@ -602,6 +602,8 @@ void GuiControl::setUpdate()
 void GuiControl::renderJustifiedText(Point2I offset, Point2I extent, const char *text)
 void GuiControl::renderJustifiedText(Point2I offset, Point2I extent, const char *text)
 {
 {
    GFont *font = mProfile->mFont;
    GFont *font = mProfile->mFont;
+   if(!font)
+      return;
    S32 textWidth = font->getStrWidthPrecise((const UTF8*)text);
    S32 textWidth = font->getStrWidthPrecise((const UTF8*)text);
    U32 textHeight = font->getHeight();
    U32 textHeight = font->getHeight();