aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/objects
diff options
context:
space:
mode:
authorwhiterandrek2018-05-13 13:08:56 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commitd11115a6aabb36043220b7c5e26e2b8f3a83660b (patch)
tree22a648e2401aa68c51993cc2605500bbaf5d9376 /engines/pink/objects
parentab4980aa59ffafcf54c1f791d9619ad317dda7a7 (diff)
downloadscummvm-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')
-rw-r--r--engines/pink/objects/pages/page.cpp9
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) {