Don't try to show exceptions in a message box if SDL was not initialized

This commit is contained in:
scrawl 2013-12-13 03:50:01 +01:00
parent 0c3c3ed8e9
commit 39eea24dc3

View file

@ -3,8 +3,7 @@
#include <components/files/configurationmanager.hpp>
#include <SDL_messagebox.h>
#include <SDL_main.h>
#include <SDL.h>
#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);