diff options
author | whiterandrek | 2018-05-13 13:08:56 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | d11115a6aabb36043220b7c5e26e2b8f3a83660b (patch) | |
tree | 22a648e2401aa68c51993cc2605500bbaf5d9376 /engines/pink/objects/pages/page.cpp | |
parent | ab4980aa59ffafcf54c1f791d9619ad317dda7a7 (diff) | |
download | scummvm-rg350-d11115a6aabb36043220b7c5e26e2b8f3a83660b.tar.gz scummvm-rg350-d11115a6aabb36043220b7c5e26e2b8f3a83660b.tar.bz2 scummvm-rg350-d11115a6aabb36043220b7c5e26e2b8f3a83660b.zip |
PINK: fixed finding of nullptr Actor
Diffstat (limited to 'engines/pink/objects/pages/page.cpp')
-rw-r--r-- | engines/pink/objects/pages/page.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/pink/objects/pages/page.cpp b/engines/pink/objects/pages/page.cpp index 1c0c67e85a..33ccf15357 100644 --- a/engines/pink/objects/pages/page.cpp +++ b/engines/pink/objects/pages/page.cpp @@ -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) { |