aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorAndrei Prykhodko2018-11-16 20:34:27 +0200
committerAndrei Prykhodko2018-11-16 20:34:27 +0200
commitacac59796174150350d65aeda3593df8d0076d8b (patch)
tree95eb460c39fcdb6e89cd7863233fd871e3c8e1b4 /engines
parent8efe46dceeaf08984477003d07efd5d80865cde5 (diff)
downloadscummvm-rg350-acac59796174150350d65aeda3593df8d0076d8b.tar.gz
scummvm-rg350-acac59796174150350d65aeda3593df8d0076d8b.tar.bz2
scummvm-rg350-acac59796174150350d65aeda3593df8d0076d8b.zip
PINK: fixed null pointer dereference in ConditionInventoryItemOwner
fixes bug #10805
Diffstat (limited to 'engines')
-rw-r--r--engines/pink/objects/condition.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/pink/objects/condition.cpp b/engines/pink/objects/condition.cpp
index f20c25e249..646da7d05c 100644
--- a/engines/pink/objects/condition.cpp
+++ b/engines/pink/objects/condition.cpp
@@ -81,7 +81,9 @@ void ConditionInventoryItemOwner::deserialize(Archive &archive) {
bool ConditionInventoryItemOwner::evaluate(Actor *actor) {
InventoryMgr *mgr = actor->getInventoryMgr();
InventoryItem *item = mgr->findInventoryItem(_item);
- return item->getCurrentOwner() == _owner;
+ if (item)
+ return item->getCurrentOwner() == _owner;
+ return false;
}
void ConditionInventoryItemOwner::toConsole() {