aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/objects/pages/page.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pink/objects/pages/page.cpp')
-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) {