so I keep getting this error but every time the bullet gets removed it crashes and do this here's the code.
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class WalkerBullet here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class WalkerBullet extends Mover
{
private int chance = 0;
boolean touchingGround = false;
int range = 900;
/**
* Act - do whatever the WalkerBullet wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move(5.0);
hit();
turn();
}
public void turn()
{
if ( ! getObjectsInRange( range, RifleTrooper.class ).isEmpty() )
{
Actor pj = getObjectsInRange( range, RifleTrooper.class ).get( 0 );
turnTowards( pj.getX(), pj.getY() );
}
}
public void hit()
{
Actor walkerbullet = getOneIntersectingObject(Platform.class);
if (walkerbullet != null)
{
if(touchingGround == false)
{
touchingGround = true;
setImage("Explosion1.png");
getWorld().removeObject(this);
} else
{
touchingGround = false;
}
}
}
}

