From ae161d1081b42be523aecb72dfe209d6aee6f770 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 2 Jul 2018 14:43:49 +0300 Subject: [PATCH] Don't allow iterators on empty animations --- source/animation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 2.43.0