aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sword1/resman.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/sword1/resman.cpp b/engines/sword1/resman.cpp
index 3e8ee93c52..7222965c9d 100644
--- a/engines/sword1/resman.cpp
+++ b/engines/sword1/resman.cpp
@@ -228,7 +228,9 @@ Header *ResMan::lockScript(uint32 scrID) {
openScriptResourceLittleEndian(scrID);
#endif
MemHandle *handle = resHandle(scrID);
- return handle != NULL ? (Header *)handle->data : NULL;
+ if (!handle)
+ error("Script resource handle %d not found", scrID);
+ return (Header *)handle->data;
}
void ResMan::unlockScript(uint32 scrID) {