Unplanned
Last Updated: 27 Sep 2024 05:16 by ADMIN
Ivan
Created on: 26 Sep 2024 10:19
Category: RichTextBox
Type: Bug Report
0
RichTextBox: NullReferenceException when loading a document with a continuous section break.
NullReferenceException when loading a document with a continuous section break.
2 comments
ADMIN
Dimitar
Posted on: 27 Sep 2024 05:16

Hi Ivan,

Thanks for sharing this. Please note that we keep detailed internal description for the issues as well. 

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.

Ivan
Posted on: 26 Sep 2024 16:38

Here is a stack trace that relates to the scenario:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Documents.Layout.SectionLayoutBox.MeasureOverride(SizeF availableSize)
   at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize)
   at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize)
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.MeasureOverrideInternal(SizeF availableSize)
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.MeasureOverride(SizeF availableSize)
   at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize)
   at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize)
   at Telerik.Windows.Documents.Model.RadDocument.Measure(SizeF measureSize)
   at Telerik.Windows.Documents.UI.DocumentPrintLayoutPresenter.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.UIElement.UpdateLayout()
   at Telerik.Windows.Documents.UI.DocumentPresenterBase.Telerik.Windows.Controls.IDocumentEditorPresenter.UpdateLayout()
   at Telerik.Windows.Controls.RadRichTextBox.<>c__DisplayClass620_0.<UpdateEditorLayout>b__0()
   at Telerik.Windows.Controls.RadRichTextBox.UpdateEditorLayout(Boolean focusCarret, Boolean updateCaretSize, Boolean async)
   at Telerik.Windows.Controls.RadRichTextBox.UpdateEditorLayout(Boolean async)
   at Telerik.Windows.Controls.RadRichTextBox.UpdateEditorLayout()
   at Telerik.Windows.Controls.RichTextBoxUI.Dialogs.Styles.StyleDataCollection..ctor(RadDocument document, RadRichTextBox snapshotRichtextBox, Int32 snapshotWidth, Int32 snapshotHeight, Boolean addClearAllStyle, Boolean onlyPrimary)
   at Telerik.Windows.Controls.RichTextBoxUI.StylesGallery.SetQuickStyleItemSource(RadRichTextBox radRichTextBox)
   at Telerik.Windows.Controls.RichTextBoxUI.StylesGallery.RadRichTextBox_DocumentChanged(Object sender, EventArgs e)
   at Telerik.Windows.Controls.RadRichTextBox.OnDocumentChanged()
   at Telerik.Windows.Controls.RadRichTextBox.set_Document(RadDocument value)
   at Magnet.Sierra.View.Behavior.RichTextBoxProperty.OnDocumentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in C:\code\products\sierra\Magnet.Sierra.View\Behavior\RichTextBoxProperty.cs:line 56
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
   at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
   at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)
   at MS.Internal.Data.ClrBindingWorker.OnSourcePropertyChanged(Object o, String propName)
   at MS.Internal.Data.PropertyPathWorker.OnPropertyChanged(Object sender, PropertyChangedEventArgs e)
   at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
   at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
   at System.ComponentModel.PropertyChangedEventManager.OnPropertyChanged(Object sender, PropertyChangedEventArgs args)
   at CommunityToolkit.Mvvm.ComponentModel.ObservableObject.OnPropertyChanged(PropertyChangedEventArgs e)
   at Magnet.Sierra.ViewModel.Document.Content.EditorDocumentContent.set_Document(RadDocument value) in C:\code\products\sierra\Magnet.Sierra.ViewModel\obj\Debug\net6.0-windows\CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator\Magnet.Sierra.ViewModel.Document.Content.EditorDocumentContent.g.cs:line 25
   at Magnet.Sierra.ViewModel.Document.Content.EditorDocumentContent.LoadInternal() in C:\code\products\sierra\Magnet.Sierra.ViewModel\Document\Content\EditorDocumentContent.cs:line 94
   at Magnet.Sierra.ViewModel.Document.Content.DocumentContentBase.Load() in C:\code\products\sierra\Magnet.Sierra.ViewModel\Document\Content\DocumentContentBase.cs:line 29
   at Magnet.Sierra.ViewModel.AppLayoutViewModel.<OnSelectedSectionChanged>d__44.MoveNext() in C:\code\products\sierra\Magnet.Sierra.ViewModel\AppLayoutViewModel.cs:line 80
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   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)

 

Here is another stack trace that relates to the scenario:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.UpdateChildIndexesDownToParagraph(LayoutBox layoutBox, HashSet`1 documentLists)
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.UpdateChildIndexesDownToParagraph(LayoutBox layoutBox, HashSet`1 documentLists)
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.UpdateChildIndexesDownToParagraph(LayoutBox layoutBox, HashSet`1 documentLists)
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.UpdateChildIndexesDownToParagraph(LayoutBox layoutBox, HashSet`1 documentLists)
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.UpdateChildIndexesDownToParagraph(LayoutBox layoutBox, HashSet`1 documentLists)
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.UpdateChildIndexesDownToParagraph(LayoutBox layoutBox, HashSet`1 documentLists)
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.UpdateParagraphInListSorting()
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.MeasureOverrideInternal(SizeF availableSize)
   at Telerik.Windows.Documents.Layout.DocumentLayoutBox.MeasureOverride(SizeF availableSize)
   at Telerik.Windows.Documents.Layout.LayoutElement.MeasureCore(SizeF availableSize)
   at Telerik.Windows.Documents.Layout.LayoutElement.Measure(SizeF availableSize)
   at Telerik.Windows.Documents.Model.RadDocument.Measure(SizeF measureSize)
   at Telerik.Windows.Documents.UI.DocumentPrintLayoutPresenter.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   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)