summaryrefslogtreecommitdiff
path: root/src/spellmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/spellmanager.cpp')
-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;