Add check for undefined geometry to bars hit function