NullPointerException from the Game package freeze the entire applciation
Closed this issue · 0 comments
hiniko commented
The null pointer needs to be caught and the user alerted at what went wrong. This can only happen if the user has tried to use a variable such as nearestFood
if they are not near any food. The variable is set to null upon every update.
Currently users must be using a code block similar to below to avoid this. Perhaps a null check is need in every case this can happen? The users needs alerting that the code will not work and why.
if ( nearFood())
{
goTo(nearestFood);
}