Can you wrap this block in a `try / with` statement?  Accessing the `TextViewLines` property can and will throw an exception if the view is in a transient state such as rendering.