Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException after upgrading to 7.0.0 #746

Closed
pschimmel opened this issue Sep 29, 2019 · 2 comments
Closed

NullReferenceException after upgrading to 7.0.0 #746

pschimmel opened this issue Sep 29, 2019 · 2 comments
Assignees
Labels
Milestone

Comments

@pschimmel
Copy link
Contributor

Hi!

Thank you for releasing Version 7.0.0 👍

I just gave Version 7.0.0 a try in our application by upgrading from version 5.0.1.
But when I start the application I get a NullReferenceException with the following stack trace.
Unfortunately I was not able to reproduce the issue in a test project that I could attach.

I will investigate further and post any new findings here.

Stack trace:
at Fluent.InRibbonGallery.OnSizePropertyChanged(RibbonControlSize previous, RibbonControlSize current) in C:\projects\fluent-ribbon\Fluent.Ribbon\Controls\InRibbonGallery.cs:line 1287
at Fluent.RibbonProperties.OnSizeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in C:\projects\fluent-ribbon\Fluent.Ribbon\AttachedProperties\RibbonProperties.cs:line 51
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.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at Fluent.RibbonGroupBox.UpdateChildSizes() in C:\projects\fluent-ribbon\Fluent.Ribbon\Controls\RibbonGroupBox.cs:line 150
at Fluent.Internal.ItemContainerGeneratorAction.QueueAction() in C:\projects\fluent-ribbon\Fluent.Ribbon\Internal\ItemContainerGeneratorAction.cs:line 56
at Fluent.RibbonGroupBox.OnStateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in C:\projects\fluent-ribbon\Fluent.Ribbon\Controls\RibbonGroupBox.cs:line 124
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.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Fluent.RibbonGroupBox.get_DesiredSizeIntermediate() in C:\projects\fluent-ribbon\Fluent.Ribbon\Controls\RibbonGroupBox.cs:line 810
at Fluent.RibbonGroupsContainer.GetChildrenDesiredSizeIntermediate() in C:\projects\fluent-ribbon\Fluent.Ribbon\Controls\RibbonGroupsContainer.cs:line 194
at Fluent.RibbonGroupsContainer.MeasureOverride(Size availableSize) in C:\projects\fluent-ribbon\Fluent.Ribbon\Controls\RibbonGroupsContainer.cs:line 143
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.InvokeOnRenderCallback.DoWork()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(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)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(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 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
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)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at MyApp.Main(String[] args) in C:\MyApp\Entry.cs:line 127


Environment

  • Fluent.Ribbon v7.0.0
  • Windows 10
  • .NET Framework 4.7.1
@batzen batzen self-assigned this Sep 30, 2019
@batzen batzen added this to the 7.0.1 milestone Sep 30, 2019
@pschimmel
Copy link
Contributor Author

pschimmel commented Oct 2, 2019

Hi again!

I was now able to reproduce the exception in the Showcase application.

For some reason we hide/show ribbon items, including the gallery, dynamically in our application.

To reproduce the issue you'll just have to set the Visibility property of an InRibbonGallery to "Collapsed" in the Showcase application. After starting the application activate the "Galleries" tab and change the width of the main window until the Exception happens.

The problem is that in the Reduce() method of InRibbonGallery.cs, the galleryPanel is null.

@batzen
Copy link
Member

batzen commented Oct 21, 2019

@pschimmel I already fixed it in a separate branch but won't be able to release until mid november, sorry.

batzen added a commit that referenced this issue Dec 1, 2019
batzen added a commit that referenced this issue Dec 1, 2019
@batzen batzen closed this as completed in 722f265 Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants