From 9cbae5252ff249946a6b2ab2c65961dd36b7b098 Mon Sep 17 00:00:00 2001 From: Julien Templier Date: Mon, 18 Oct 2010 23:06:52 +0000 Subject: 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 --- engines/lastexpress/data/sequence.cpp | 7 +++++++ engines/lastexpress/data/sequence.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'engines') 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; -- cgit v1.2.3