diff options
author | Thierry Crozat | 2013-04-24 21:55:34 +0100 |
---|---|---|
committer | Thierry Crozat | 2013-04-24 21:55:34 +0100 |
commit | 5fc59f9bd8f0752bb5f1f81ab1c82d7276279cd3 (patch) | |
tree | ae700306163f90bbe6d33c4e4ee8737294f35c72 | |
parent | ff1bdc7f5840e2d281f99cd2f74144a5473a180f (diff) | |
download | scummvm-rg350-5fc59f9bd8f0752bb5f1f81ab1c82d7276279cd3.tar.gz scummvm-rg350-5fc59f9bd8f0752bb5f1f81ab1c82d7276279cd3.tar.bz2 scummvm-rg350-5fc59f9bd8f0752bb5f1f81ab1c82d7276279cd3.zip |
SWORD1: Error our in case the resource handle is not found in lockScript
This should never happen, so as per wjp suggestion makes this an error.
-rw-r--r-- | engines/sword1/resman.cpp | 4 |
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) { |