Add check for potentially null history on view.html