Merge branch 'fix-6660' into 'master'

Fix #6660: Crash during intro video when closing the game

Closes #6660

See merge request OpenMW/openmw!1707
pull/3226/head
psi29a 3 years ago
commit c99db4a66f

@ -25,7 +25,10 @@ osg::ref_ptr<ESMTerrain::LandObject> LandManager::getLand(int x, int y)
return static_cast<ESMTerrain::LandObject*>(obj.get());
else
{
const ESM::Land* land = MWBase::Environment::get().getWorld()->getStore().get<ESM::Land>().search(x,y);
const auto* world = MWBase::Environment::get().getWorld();
if (!world)
return nullptr;
const ESM::Land* land = world->getStore().get<ESM::Land>().search(x,y);
if (!land)
return nullptr;
osg::ref_ptr<ESMTerrain::LandObject> landObj (new ESMTerrain::LandObject(land, mLoadFlags));

Loading…
Cancel
Save