From 5b38e2f4601ecde262e7c0962a46b81e57889fe0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 17 Apr 2014 00:58:49 +0300 Subject: Add missing check in spellmanager. This fix crash in spells window if try drag empty cell. --- src/spellmanager.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/spellmanager.cpp') diff --git a/src/spellmanager.cpp b/src/spellmanager.cpp index b1fad932a..cd4f0f2fd 100644 --- a/src/spellmanager.cpp +++ b/src/spellmanager.cpp @@ -399,6 +399,9 @@ void SpellManager::swap(const int id1, const int id2) { TextCommand *const spell1 = mSpells[id1]; TextCommand *const spell2 = mSpells[id2]; + if (!spell1 || !spell2) + return; + // swap in map mSpells[id1] = spell2; mSpells[id2] = spell1; -- cgit v1.2.3-70-g09d2