From 4435902f1e1d9265add6f23966f42b6cce753cd0 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 14 May 2016 11:31:51 +0200 Subject: PEGASUS: Add safety check. The code which follows in the method has this check, assuming that a null dereference is potentially possible. --- engines/pegasus/neighborhood/mars/mars.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/pegasus/neighborhood') diff --git a/engines/pegasus/neighborhood/mars/mars.cpp b/engines/pegasus/neighborhood/mars/mars.cpp index df5a75541c..7c4a8a98ba 100644 --- a/engines/pegasus/neighborhood/mars/mars.cpp +++ b/engines/pegasus/neighborhood/mars/mars.cpp @@ -1950,7 +1950,7 @@ void Mars::pickedUpItem(Item *item) { } void Mars::dropItemIntoRoom(Item *item, Hotspot *dropSpot) { - if (dropSpot->getObjectID() == kAttackRobotHotSpotID) { + if (dropSpot && dropSpot->getObjectID() == kAttackRobotHotSpotID) { _attackingItem = (InventoryItem *)item; startExtraSequence(kMars48RobotDefends, kExtraCompletedFlag, kFilterNoInput); loadLoopSound2(""); -- cgit v1.2.3