Call to a member function doHit() on null