Skip to content

Commit fe7ea53

Browse files
Fix a NULL-ptr crash on startup for Win32 server
1 parent 9e75370 commit fe7ea53

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

engine/src/graphics_util.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,12 @@ static inline MCGFont MCFontStructToMCGFont(MCFontStruct *p_font)
348348
static inline MCGFont MCFontStructToMCGFont(MCFontStruct *p_font)
349349
{
350350
MCGFont t_font;
351+
if (p_font == nil)
352+
{
353+
MCMemoryClear(&t_font, sizeof(t_font));
354+
return t_font;
355+
}
356+
351357
t_font . size = p_font -> size;
352358
t_font . ascent = p_font -> ascent;
353359
t_font . descent = p_font -> descent;

0 commit comments

Comments
 (0)