Um, I'm not sure, with missing `begin` the `ensure` would be valid for whole method, which is IMHO actually not desired.

If `UI.OpenDialog` at the beginning raises an exception then it does not make sense to call `UI.CloseDialog` at the end as there is no dialog open.

@jreidinger what's your opinion in this case?