summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/touchactions.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/touchactions.cpp b/src/touchactions.cpp
index ac3e45699..c88a25cf8 100644
--- a/src/touchactions.cpp
+++ b/src/touchactions.cpp
@@ -148,7 +148,10 @@ impHandler0(attackClick)
impHandler0(cancelClick)
{
- ActionManager::stopAttack(tempEvent);
- if (!player_node->getTarget())
- ActionManager::sit(tempEvent);
+ if (player_node)
+ {
+ ActionManager::stopAttack(tempEvent);
+ if (!player_node->getTarget())
+ ActionManager::sit(tempEvent);
+ }
}