From e7ebc6c703cd31577bd78f7b133ba18c5dfab1a9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 21 Mar 2016 02:51:37 +0300 Subject: Fix possible crash in skill cooldowns. --- src/gui/windows/skilldialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gui/windows/skilldialog.cpp') diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index c5eb45c02..a11e0b5aa 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -849,7 +849,7 @@ void SkillDialog::addSkillDuration(SkillInfo *const skill) void SkillDialog::slowLogic() { - FOR_EACH (std::vector::iterator, it, mDurations) + FOR_EACH_SAFE (std::vector::iterator, it, mDurations) { SkillInfo *const skill = *it; if (skill) @@ -861,6 +861,8 @@ void SkillDialog::slowLogic() skill->cooldown = 0; skill->duration = 0; skill->durationTime = 0; + if (it == mDurations.end()) + return; if (it != mDurations.begin()) -- it; } -- cgit v1.2.3-70-g09d2