Sfoglia il codice sorgente

Small crash fix

Crash fix when font isn't set.
Nathan Bowhay 10 anni fa
parent
commit
d0972c9be1
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      Engine/source/gui/core/guiControl.cpp

+ 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)
 {
    GFont *font = mProfile->mFont;
+   if(!font)
+      return;
    S32 textWidth = font->getStrWidthPrecise((const UTF8*)text);
    U32 textHeight = font->getHeight();