if (game.getEntity(action.getEntityId()).isActive()) {
Entity entity = game.getEntity(action.getEntityId()); if (entity != null && entity.isActive()) {
    private void removeDeadAttacks() {        Vector toKeep = new Vector(attacks.size());                for (Enumeration i = attacks.elements(); i.hasMoreElements();) {            EntityAction action = (EntityAction)i.nextElement();            if (game.getEntity(action.getEntityId()).isActive()) {                toKeep.addElement(action);            }        }                attacks = toKeep;    }