fixed bug with trying to display exit message screen in headless mode
[rocksndiamonds.git] / src / init.c
index adb7afdfdb39175f0f274869049e739d7f251e56..eeb8af52d01dff918c67ccd82e3ad084cc4812bd 100644 (file)
@@ -5878,6 +5878,10 @@ void KeyboardAutoRepeatOffUnlessAutoplay()
 
 void DisplayExitMessage(char *format, va_list ap)
 {
+  // also check for initialized video (headless flag may be temporarily unset)
+  if (program.headless || !video.initialized)
+    return;
+
   // check if draw buffer and fonts for exit message are already available
   if (drawto == NULL || font_initial[NUM_INITIAL_FONTS - 1].bitmap == NULL)
     return;