reset state correctly also for starting page

When navigating back to the base url (rfhub/doc), state
object is null in history. Handle this special case correctly.