Account for empty victimRef (Bug #4328)

pull/392/head
Capostrophic 7 years ago committed by Capostrophic
parent 929fc68160
commit cc0c6ddaa6

@ -1120,7 +1120,7 @@ namespace MWMechanics
if (!Misc::StringUtils::ciEqual(item.getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId))
{
const MWWorld::Ptr victimRef = MWBase::Environment::get().getWorld()->searchPtr(item.getCellRef().getOwner(), true);
if (!victimRef.getClass().getCreatureStats(victimRef).isDead())
if (victimRef.isEmpty() || !victimRef.getClass().getCreatureStats(victimRef).isDead())
mStolenItems[Misc::StringUtils::lowerCase(item.getCellRef().getRefId())][owner] += count;
}
if (alarm)

Loading…
Cancel
Save