Pending Review
Last Updated: 10 Apr 2026 15:25 by Daniel

Since the last update, we receive often the following exception from our users log. I don't know exactly how to reproduce, but I know that when it happens, the user tries to click anywhere in the document and each time the exception is thrown. The users need to close and reopen the document to make it work again.

System.NullReferenceException: Object reference not set to an instance of an object. at Telerik.Windows.Documents.UI.DocumentPresenterBase.CaretPosition_PositionChanged(Object sender, EventArgs e) at Telerik.Windows.Documents.DocumentPosition.MoveToPosition(DocumentPosition newPosition) at Telerik.Windows.Documents.Selection.MouseSelectionHandler.UpdateSelectionAndCaretPosition() at Telerik.Windows.Documents.Selection.MouseSelectionHandler.RegisterDocumentMouseMove(Point position, SourceType source) at Telerik.Windows.Documents.UI.DocumentPresenterBase.HandleMouseMoveOnPosition(Point position, SourceType source) at Telerik.Windows.Documents.UI.DocumentPresenterBase.Owner_MouseMove(Object sender, MouseEventArgs e) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.MouseDevice.Synchronize() at System.Windows.Input.MouseDevice.PostProcessInput(Object sender, ProcessInputEventArgs e) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

We also had this case when we try programatically to move the caret (seems to be the same end result exception):

System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Documents.UI.DocumentPresenterBase.CaretPosition_PositionChanged(Object sender, EventArgs e)
   at Telerik.Windows.Documents.DocumentPosition.MoveToDocumentStart()
   at Telerik.Windows.Documents.DocumentPosition.MoveToFirstPositionInDocument()