aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/klists.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/klists.cpp')
-rw-r--r--engines/sci/engine/klists.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index 37f60d2830..9a63b39f18 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -473,6 +473,10 @@ reg_t kListAt(EngineState *s, int argc, reg_t *argv) {
List *list = s->_segMan->lookupList(argv[0]);
reg_t curAddress = list->first;
+ if (list->first.isNull()) {
+ warning("kListAt tried to reference empty list (%04x:%04x)", PRINT_REG(argv[0]));
+ return NULL_REG;
+ }
Node *curNode = s->_segMan->lookupNode(curAddress);
reg_t curObject = curNode->value;
int16 listIndex = argv[1].toUint16();