Skip to content

Commit

Permalink
PINK: fixed finding of nullptr Actor
Browse files Browse the repository at this point in the history
  • Loading branch information
voltya authored and sev- committed Jun 28, 2018
1 parent ab4980a commit d11115a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions engines/pink/objects/pages/page.cpp
Expand Up @@ -39,10 +39,15 @@ void Page::load(Archive &archive) {
}

Actor *Page::findActor(const Common::String &name) {
return *Common::find_if(_actors.begin(), _actors.end(), [&name]
auto it = Common::find_if(_actors.begin(), _actors.end(), [&name]
(Actor *actor) {
return name == actor->getName();
});;
});

if (it == _actors.end())
return nullptr;

return *it;
}

Sound *Page::loadSound(Common::String &fileName) {
Expand Down

0 comments on commit d11115a

Please sign in to comment.