Last Updated: 13 Apr 2020 13:55 by ADMIN
Created on: 11 Apr 2020 07:25
Category: RichTextBox
Type: Bug Report
PasteOptionsPopup throws an unhandled Dispatcher exception in an infinite loop

I have no idea how to reproduce this, but every so often after a paste operation into a RadRichTextBox, the host thread becomes unresponsive to user input. The message pump is still running but the following unhandled exception gets thrown in a tight infinite loop. The only way to close the window is to right click on the taskbar button.

Message: Object reference not set to an instance of an object.
Call Stack:
    at Telerik.Windows.Documents.Layout.LayoutElement.SetParent(LayoutElement newParent)
    at Telerik.Windows.Documents.Layout.LayoutBox.EnsureParent()
    at Telerik.Windows.Documents.Layout.LayoutBox.get_Parent()
    at Telerik.Windows.Documents.Layout.FormattingSymbolLayoutBox.get_IsEndOfCell()
    at Telerik.Windows.Documents.Layout.FormattingSymbolLayoutBox.GetFormattingSymbolVisual()
    at Telerik.Windows.Documents.SpanBoxPositionHandler.get_Location()
    at Telerik.Windows.Documents.UI.DocumentWebLayoutPresenter.GetViewPointFromDocumentPosition(DocumentPosition position)
    at Telerik.Windows.Controls.RichTextBoxUI.PasteOptionsPopup.CalculateLocation()
    at Telerik.Windows.Controls.RichTextBoxUI.PasteOptionsPopup.OnOwnerLayoutUpdated(Object sender, EventArgs e)
    at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
    at System.Windows.ContextLayoutManager.UpdateLayout()
    at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
    at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
    at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
    at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
    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)


1 comment
Posted on: 13 Apr 2020 13:55

Hello Joshua,

This seems to be caused by a known issue related to the Undo action. We have an item logged in our backlog fix this: RichTextBox: NullReferenceException is thrown when undoing font size changes in a table containing a single cell. I am afraid I cannot provide a workaround at the moment. Please excuse us for the inconvenience caused. Please, make sure you cast your vote for the implementation as well as subscribe to the task by clicking the Follow button so you can receive updates about status changes.

I hope you find this information helpful. Please, let me know if there is anything else I can assist you with.

Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.