When destroying a modal dialog that was never shown, an error occrus when trying to remove a null overlay