From: Mikko Rasa Date: Mon, 2 Jul 2018 11:43:49 +0000 (+0300) Subject: Don't allow iterators on empty animations X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=ae161d1081b42be523aecb72dfe209d6aee6f770;ds=sidebyside Don't allow iterators on empty animations --- diff --git a/source/animation.cpp b/source/animation.cpp index 02a2d371..1cfb533f 100644 --- a/source/animation.cpp +++ b/source/animation.cpp @@ -272,7 +272,10 @@ Animation::Iterator::Iterator(const Animation &a): event_iter(animation->events.begin()), x(0), end(false) -{ } +{ + if(iter==animation->keyframes.end()) + throw invalid_argument("Animation::Iterator::Iterator"); +} Animation::Iterator &Animation::Iterator::operator+=(const Time::TimeDelta &t) {