Fixed issue causing the app to crash when a dialog was open and a
configuration change was detected.