Don't segfault if null device creation failed

This commit is contained in:
Deve 2018-09-06 22:56:55 +02:00
parent e3b3a369d0
commit 8e29c189c4

View File

@ -1647,6 +1647,12 @@ void initRest()
stk_config->load(file_manager->getAsset("stk_config.xml")); stk_config->load(file_manager->getAsset("stk_config.xml"));
irr_driver = new IrrDriver(); irr_driver = new IrrDriver();
if (irr_driver->getDevice() == NULL)
{
Log::fatal("main", "Couldn't initialise irrlicht device. Quitting.\n");
}
StkTime::init(); // grabs the timer object from the irrlicht device StkTime::init(); // grabs the timer object from the irrlicht device
// Now create the actual non-null device in the irrlicht driver // Now create the actual non-null device in the irrlicht driver