aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2010-09-26 12:22:46 +0000
committerTravis Howell2010-09-26 12:22:46 +0000
commit184833924b851b8da29101b868269b785d17cd17 (patch)
treef819bb230f5b98c02676fb0d47b93e2b0dd3bcc6
parent113e14224dce3fca92dc6a7592dd57e28dfcd24a (diff)
downloadscummvm-rg350-184833924b851b8da29101b868269b785d17cd17.tar.gz
scummvm-rg350-184833924b851b8da29101b868269b785d17cd17.tar.bz2
scummvm-rg350-184833924b851b8da29101b868269b785d17cd17.zip
AGOS: Fix bug #3011638 - WAXWORKS: Crash retrieving spear from the crocodile carcass.
svn-id: r52906
-rw-r--r--engines/agos/items.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp
index 874bf1a802..6c6b127a51 100644
--- a/engines/agos/items.cpp
+++ b/engines/agos/items.cpp
@@ -429,6 +429,9 @@ Item *AGOSEngine::findMaster(int16 a, int16 n) {
for (j = 1; j < _itemArraySize; j++) {
Item *item = derefItem(j);
+ if (item == NULL)
+ continue;
+
if (wordMatch(item, a, n))
return item;
}
@@ -442,6 +445,9 @@ Item *AGOSEngine::nextMaster(Item *i, int16 a, int16 n) {
for (j = first; j < _itemArraySize; j++) {
Item *item = derefItem(j);
+ if (item == NULL)
+ continue;
+
if (wordMatch(item, a, n))
return item;
}