From acac59796174150350d65aeda3593df8d0076d8b Mon Sep 17 00:00:00 2001 From: Andrei Prykhodko Date: Fri, 16 Nov 2018 20:34:27 +0200 Subject: PINK: fixed null pointer dereference in ConditionInventoryItemOwner fixes bug #10805 --- engines/pink/objects/condition.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/pink/objects') 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() { -- cgit v1.2.3