ソースを参照

Small crash fix

Crash fix when font isn't set.
Nathan Bowhay 10 年 前
コミット
d0972c9be1
1 ファイル変更2 行追加0 行削除
  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)
 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();