diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-04-17 00:58:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-04-17 00:59:20 +0300 |
commit | 5b38e2f4601ecde262e7c0962a46b81e57889fe0 (patch) | |
tree | d431a8df2efcf5f92c8429a1ff4d4c7af5335408 | |
parent | 09963adfe919180f5936d048b4ab7a057134a8ff (diff) | |
download | mv-5b38e2f4601ecde262e7c0962a46b81e57889fe0.tar.gz mv-5b38e2f4601ecde262e7c0962a46b81e57889fe0.tar.bz2 mv-5b38e2f4601ecde262e7c0962a46b81e57889fe0.tar.xz mv-5b38e2f4601ecde262e7c0962a46b81e57889fe0.zip |
Add missing check in spellmanager.
This fix crash in spells window if try drag empty cell.
-rw-r--r-- | src/spellmanager.cpp | 3 |
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; |