Merge "Fix crash when trying to dismiss dialog"