diff options
author | Julien Templier | 2010-10-18 23:06:52 +0000 |
---|---|---|
committer | Julien Templier | 2010-10-18 23:06:52 +0000 |
commit | 9cbae5252ff249946a6b2ab2c65961dd36b7b098 (patch) | |
tree | eba2be93ac9d0f694c50e87442b50d7e0278035a | |
parent | 70566beb78cc637b0d94ff587c4735d6edaa73ac (diff) | |
download | scummvm-rg350-9cbae5252ff249946a6b2ab2c65961dd36b7b098.tar.gz scummvm-rg350-9cbae5252ff249946a6b2ab2c65961dd36b7b098.tar.bz2 scummvm-rg350-9cbae5252ff249946a6b2ab2c65961dd36b7b098.zip |
LASTEXPRESS: Check for a valid sequence in SequenceFrame::getName
This allows the demo to fail gracefully to the debugger instead of crashing
svn-id: r53595
-rw-r--r-- | engines/lastexpress/data/sequence.cpp | 7 | ||||
-rw-r--r-- | engines/lastexpress/data/sequence.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/engines/lastexpress/data/sequence.cpp b/engines/lastexpress/data/sequence.cpp index be8b14fc27..cf71bd6a61 100644 --- a/engines/lastexpress/data/sequence.cpp +++ b/engines/lastexpress/data/sequence.cpp @@ -468,6 +468,13 @@ FrameInfo *SequenceFrame::getInfo() { return _sequence->getFrameInfo(_frame); } +Common::String SequenceFrame::getName() { + if (!_sequence) + error("SequenceFrame::getName: Invalid sequence!"); + + return _sequence->getName(); +} + bool SequenceFrame::equal(const SequenceFrame *other) const { return _sequence->getName() == other->_sequence->getName() && _frame == other->_frame; } diff --git a/engines/lastexpress/data/sequence.h b/engines/lastexpress/data/sequence.h index 7de4b2dfa4..25170993df 100644 --- a/engines/lastexpress/data/sequence.h +++ b/engines/lastexpress/data/sequence.h @@ -189,7 +189,7 @@ public: uint32 getFrame() { return _frame; } bool nextFrame(); - Common::String getName() { return _sequence->getName(); } + Common::String getName(); FrameInfo *getInfo(); bool equal(const SequenceFrame *other) const; |