summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-04-17 00:58:49 +0300
committerAndrei Karas <akaras@inbox.ru>2014-04-17 00:59:20 +0300
commit5b38e2f4601ecde262e7c0962a46b81e57889fe0 (patch)
treed431a8df2efcf5f92c8429a1ff4d4c7af5335408
parent09963adfe919180f5936d048b4ab7a057134a8ff (diff)
downloadmanaverse-5b38e2f4601ecde262e7c0962a46b81e57889fe0.tar.gz
manaverse-5b38e2f4601ecde262e7c0962a46b81e57889fe0.tar.bz2
manaverse-5b38e2f4601ecde262e7c0962a46b81e57889fe0.tar.xz
manaverse-5b38e2f4601ecde262e7c0962a46b81e57889fe0.zip
Add missing check in spellmanager.
This fix crash in spells window if try drag empty cell.
-rw-r--r--src/spellmanager.cpp3
1 files changed, 3 insertions, 0 deletions
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;