Wrote null-pointer protection into UIElement interactions