make sure door.data isn't nil

This commit is contained in:
Lilian Jónsdóttir 2021-08-22 00:27:45 -07:00
parent 567693e8e3
commit e677d37870

View file

@ -377,7 +377,7 @@ this.processDoors = function(cell)
-- unlock, don't need all the extra overhead that comes along with checks.isIgnoredDoor here
for door in cell:iterateReferences(tes3.objectType.door) do
-- only unlock doors that we locked before
if door.data.NPCsGoHome and door.data.NPCsGoHome.modified then
if door.data and door.data.NPCsGoHome and door.data.NPCsGoHome.modified then
door.data.NPCsGoHome.modified = false
tes3.setLockLevel({reference = door, level = 0})