Skip to content

Commit

Permalink
Fix crash in Clear Sky when font is missing for 3tButton (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Nov 4, 2023
1 parent d62cc1e commit ae3d80d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/xrUICore/XML/UIXmlInitBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,14 @@ bool CUIXmlInitBase::InitText(CUIXml& xml_doc, LPCSTR path, int index, CUILines*
CGameFont* pTmpFont = NULL;
InitFont(xml_doc, path, index, color, pTmpFont);
pLines->SetTextColor(color);
R_ASSERT(pTmpFont);
pLines->SetFont(pTmpFont);
if (pTmpFont)
pLines->SetFont(pTmpFont);
else
{
#ifndef MASTER_GOLD
Msg("~ Missing 'font' attribute in node [%s] in file [%s]", path, xml_doc.m_xml_file_name);
#endif
}

// Load font alignment
shared_str al = xml_doc.ReadAttrib(path, index, "align");
Expand Down

0 comments on commit ae3d80d

Please sign in to comment.