Fixes a hard-crash that would occur when a nullptr was passed to DetourNavigation::removeAgent(Ref<DetourCrowdAgent> agent), which would then attempt to call DetourCrowdAgent::destroy() on it.
I encountered this crash when destroying an agent that was in an invalid state (e.g. not close enough to the navigation mesh for dtNavMeshQuery::findNearestPoly to return a result).
Fixes a hard-crash that would occur when a nullptr was passed to
DetourNavigation::removeAgent(Ref<DetourCrowdAgent> agent)
, which would then attempt to callDetourCrowdAgent::destroy()
on it.I encountered this crash when destroying an agent that was in an invalid state (e.g. not close enough to the navigation mesh for
dtNavMeshQuery::findNearestPoly
to return a result).