aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/dm/dungeonman.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index 4e7dd9d8cd..74979850ef 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -1584,7 +1584,8 @@ void DungeonMan::unlinkThingFromList(Thing thingToUnlink, Thing thingInList, int
Thing currThing = getNextThing(thingInList);
while (currThing.getTypeAndIndex() != thingToUnlink.toUint16()) {
if ((currThing == Thing::_endOfList) || (currThing == Thing::_none)) {
- *thingPtr = Thing::_endOfList;
+ if (thingPtr)
+ *thingPtr = Thing::_endOfList;
return;
}
currThing = getNextThing(thingInList = currThing);