]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't allow iterators on empty animations
authorMikko Rasa <tdb@tdb.fi>
Mon, 2 Jul 2018 11:43:49 +0000 (14:43 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 2 Jul 2018 11:43:49 +0000 (14:43 +0300)
source/animation.cpp

index 02a2d371c71c1d32baff99aa3a120429d8c90d91..1cfb533f94eb3cd901ecba9dc501d28433224a15 100644 (file)
@@ -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)
 {