question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NRE in TooltipService

See original GitHub issue

Describe the bug Trying to set a tooltip for a TextBlock that is being destroyed/recycled ends up throwing a NRE.

To Reproduce It’s not easy to reproduce but maybe it’s easier to go through the implementation and protect the NRE exception. To reproduce, it needs to set a tooltip while the TextBlock is being destroyed/recycled in a virtualized list.

Expected behavior No NRE exception is thrown.

CallStack

Object reference not set to an instance of an object.
   at Avalonia.Controls.ToolTipService.TipChanged(AvaloniaPropertyChangedEventArgs e) in /_/src/Avalonia.Controls/ToolTipService.cs:line 25
   at System.Reactive.Subjects.Subject`1.OnNext(T value) in /_/Rx.NET/Source/src/System.Reactive/Subjects/Subject.cs:line 149
   at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaPropertyChangedEventArgs`1 change) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 807
   at Avalonia.AvaloniaObject.ValueChanged[T](AvaloniaPropertyChangedEventArgs`1 change) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 564
   at Avalonia.ValueStore.NotifyValueChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 365
   at Avalonia.ValueStore.SetExisting[T](Object slot, StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 265
   at Avalonia.ValueStore.SetValue[T](StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 99
   at Avalonia.Controls.ToolTip.SetTip(Control element, Object value) in /_/src/Avalonia.Controls/ToolTip.cs:line 99
   at AppUiFramework.Controls.TextBlockAutoTooltip.SetupTooltipVisibility(TextLayout layout)
   at AppUiFramework.Controls.TextBlockAutoTooltip.CreateTextLayout(String text)
   at Avalonia.Controls.TextBlock.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/TextBlock.cs:line 709

Desktop (please complete the following information):

  • OS: Windows/Mac/Linux
  • Version: preview4.

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
danipencommented, Mar 8, 2023

Still reproduced in 11.0.999-cibuild0031655-beta (the latest build I found, from 17 hours ago).

0reactions
danipencommented, Mar 8, 2023

I paste here a video, so you can better figure out how to repro:

https://user-images.githubusercontent.com/501613/223725055-d0d49254-356b-4562-a224-02d4422b3aa7.mp4

Read more comments on GitHub >

github_iconTop Results From Across the Web

ToolTipService Class (System.Windows.Controls)
Represents a service that provides properties and events to control the display and behavior of tooltips.
Read more >
ToolTipService Class (Windows.UI.Xaml.Controls)
Represents a service that provides static methods to display a ToolTip.
Read more >
How to programmatically access ToolTipService of a ...
So I am recursing through the tree and for each element that is a FrameworkElement , I want to know whether it has...
Read more >
Proposal: Use ToolTipService.Tooltip as default value of ...
Proposal: Use ToolTipService.Tooltip as default value of AutomationProperties.Name in Some Scenario. Summary.
Read more >
Dot Net 6 - ToolTips Sometimes Throw Exceptions Due To ...
Greetings, Lately we have been having a seemingly random error occur in our application when the user has a tool tip closing.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found