aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_scripts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mohawk/riven_scripts.cpp')
-rw-r--r--engines/mohawk/riven_scripts.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp
index 99f1eecf6e..8c6c9745a1 100644
--- a/engines/mohawk/riven_scripts.cpp
+++ b/engines/mohawk/riven_scripts.cpp
@@ -120,6 +120,10 @@ void RivenScriptManager::clearStoredMovieOpcode() {
}
void RivenScriptManager::runScript(const RivenScriptPtr &script, bool queue) {
+ if (!script || script->empty()) {
+ return;
+ }
+
if (!queue) {
script->run();
} else {
@@ -239,7 +243,9 @@ const char *RivenScript::getTypeName(uint16 type) {
}
RivenScriptPtr &operator+=(RivenScriptPtr &lhs, const RivenScriptPtr &rhs) {
- *lhs += *rhs;
+ if (rhs) {
+ *lhs += *rhs;
+ }
return lhs;
}