diff --git a/src/items/swatter.cpp b/src/items/swatter.cpp index 4c2012c52..bddfc4935 100644 --- a/src/items/swatter.cpp +++ b/src/items/swatter.cpp @@ -351,7 +351,7 @@ void Swatter::chooseTarget() } } // Not larger than 2^5 - 1 for kart id for optimizing state saving - if (closest_kart->getWorldKartId() < 31) + if (closest_kart && closest_kart->getWorldKartId() < 31) m_closest_kart = closest_kart; else m_closest_kart = NULL;