Declined
Last Updated: 29 Feb 2024 07:39 by ADMIN
Joshua
Created on: 11 Apr 2020 07:25
Category: RichTextBox
Type: Bug Report
0
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.

System.NullReferenceException
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)

 

3 comments
ADMIN
Dimitar
Posted on: 29 Feb 2024 07:39

Hi Joshua,

This is an old issue that was resolved (the post of Marin points to the real issue). I  can see that you have an active license. This is why I want to recommend posting a support ticket once you can reproduce it. This way we can properly investigate and determine what is causing this.  

Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Valentin
Posted on: 29 Feb 2024 03:45

We're experiencing a very similar issue as well.

A search yielded this https://stackoverflow.com/questions/14211306/stack-overflow-after-an-exception-in-control-layoutupdated-if-dispatcherunhandle which appears to be somewhat related.

It turns out that our application does register a handler for DispatcherUnhandledException in which we display a MessageBox.

The SO post seems to say that displaying the MessageBox triggers another layout pass which then likely throws the initial exception again and so on, in a loop which in our application results in a cascade of MessageBoxes like in the attached screenshot.

We're trying to obtain more information from our user to hopefully create a reproducible scenario.

Attached Files:
ADMIN
Martin
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.

Regards,
Martin
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.