1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 12:35:46 +00:00

Merge branch 'fix-6660' into 'master'

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

Closes #6660

See merge request OpenMW/openmw!1707
This commit is contained in:
psi29a 2022-03-03 20:23:48 +00:00
commit c99db4a66f

View File

@ -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));