From 39eea24dc3866760cc40b79b6d57ebbc6799fc73 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 13 Dec 2013 03:50:01 +0100 Subject: [PATCH] Don't try to show exceptions in a message box if SDL was not initialized --- apps/openmw/main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index b1bbb14f2..13e9d9241 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -3,8 +3,7 @@ #include -#include -#include +#include #include "engine.hpp" #if defined(_WIN32) && !defined(_CONSOLE) @@ -282,7 +281,7 @@ int main(int argc, char**argv) } catch (std::exception &e) { - if (isatty(fileno(stdin))) + if (isatty(fileno(stdin)) || !SDL_WasInit(SDL_INIT_VIDEO)) std::cerr << "\nERROR: " << e.what() << std::endl; else SDL_ShowSimpleMessageBox(0, "OpenMW: Fatal error", e.what(), NULL);