Before this commit, the action manager could in some case have a reference of a modal dialog, even after it has been destroyed (for example, when the "X" button has been clicked to close a modal). Unfortunately, it has some unexpected consequences, for example, the do_push_state method check the existence of self.dialog to update the url.