Fix swatter crash

This commit is contained in:
Benau 2019-03-03 16:38:02 +08:00
parent 45a55a4c9b
commit 891abf6360

View File

@ -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;