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

Do not throw when Series is null as it causes unnecessary app crash #517

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

VitalyKnyazev
Copy link
Contributor

@VitalyKnyazev VitalyKnyazev commented Jan 29, 2023

Here is a stack trace from App Center, it is a rare crash but still happens, never reproduced in dev environment:

System.ArgumentNullException: Value cannot be null.
Telerik.UI.Xaml.Controls.Chart
ChartTrackBallBehavior.GetIntersectionTemplate ($DependencyObject instance) C:_J\workspace\Nupkg_UWP_OpenSource\Controls\Chart\Chart.UWP\Visualization\Behaviors\Trackball\ChartTrackBallBehavior.cs at 245:17
Telerik.UI.Xaml.Controls.Chart
ChartTrackBallBehavior.UpdateIntersectionPoints ($ChartDataContext context) C:_J\workspace\Nupkg_UWP_OpenSource\Controls\Chart\Chart.UWP\Visualization\Behaviors\Trackball\ChartTrackBallBehavior.cs at 698:17
Telerik.UI.Xaml.Controls.Chart
ChartTrackBallBehavior.UpdateVisuals () C:_J\workspace\Nupkg_UWP_OpenSource\Controls\Chart\Chart.UWP\Visualization\Behaviors\Trackball\ChartTrackBallBehavior.cs at 578:17
Telerik.UI.Xaml.Controls.Chart
ChartTrackBallBehavior.OnChartUIUpdated () C:_J\workspace\Nupkg_UWP_OpenSource\Controls\Chart\Chart.UWP\Visualization\Behaviors\Trackball\ChartTrackBallBehavior.cs at 454:17
Telerik.UI.Xaml.Controls.Chart
RadChartBase.NotifyUIUpdated () C:_J\workspace\Nupkg_UWP_OpenSource\Controls\Chart\Chart.UWP\Visualization\RadChartBase.Manipulation.cs at 507:17
Telerik.UI.Xaml.Controls.Chart
RadChartBase.OnUIUpdated () C:_J\workspace\Nupkg_UWP_OpenSource\Controls\Chart\Chart.UWP\Visualization\RadChartBase.Manipulation.cs at 57:13
Telerik.UI.Xaml.Controls.Chart
PresenterBase.UpdateUI ($ChartLayoutContext context) C:_J\workspace\Nupkg_UWP_OpenSource\Controls\Chart\Chart.UWP\Visualization\Common\PresenterBase.cs at 185:13
Telerik.UI.Xaml.Controls.Chart
RadChartBase.CallUpdateUI () C:_J\workspace\Nupkg_UWP_OpenSource\Controls\Chart\Chart.UWP\Visualization\RadChartBase.cs at 990:13
Telerik.UI.Xaml.Controls.Chart
RadChartBase.ArrangeOverride ($Size finalSize) C:_J\workspace\Nupkg_UWP_OpenSource\Controls\Chart\Chart.UWP\Visualization\RadChartBase.cs at 766:13
Windows.UI.Xaml.FrameworkElement.global.Windows.UI.Xaml
IFrameworkElementOverrides.ArrangeOverride ($Size finalSize) global::Microsoft.UI.Xaml.Controls.IVirtualizingLayoutOverrides.MeasureOverride at 16707566
__Interop
ReverseComStubs.Stub_13 (Object __this, $Size unsafe_availableSize, $Size* unsafe_result__retval, IntPtr __methodPtr) Stub_13 at 15732480
System.Runtime.InteropServices
McgMarshal.ThrowOnExternalCallFailed (Int32, RuntimeTypeHandle)
__Interop
ComCallHelpers.Call ($__ComObject __this, RuntimeTypeHandle __typeHnd, Int32 __targetIndex) Call at 15732480
__Interop.ForwardComStubs
Stub_20<System.__Canon> (Void* InstParam, $__ComObject __this, Int32 __targetIndex) Stub_20 at 16707566
Microsoft.AppCenter.Utils
ApplicationLifecycleHelper.b__17_1 (Object sender, $UnhandledErrorDetectedEventArgs eventArgs)

@VitalyKnyazev
Copy link
Contributor Author

@polqnaP
@dilyantraykov
@APopatanasov
@vvgeorgiev
Hello, could you please review this PR? This crash still happens in prod from time to time.

@ivan-todorov-progress
Copy link
Contributor

@VitalyKnyazev Please, excuse us for the late response.

The fix seems safe to me, since the only place we are calling this method performs a null check for the returned DataTemplate. I am not certain if this is the right fix, however, or we are just trying to cure the symptom, instead of the actual problem. I believe, the real problem is why the series are null in the first place? This null check might avoid that particular crash, but it is unknown whether the app would not crash in another place later for the same reason.

I mean, this might be a symptom for a bigger problem, which might be a bug in the Chart itself or a bug in the application that is using it. Since we do not have the source code of the application, we cannot validate that on our side. Have you tried to open an issue in our support portal? There you can submit some source code to debug on our side, without fear it would go to the public.

@ivan-todorov-progress
Copy link
Contributor

@VitalyKnyazev Kindly reminder: please fill in the Contributor's License Agreement, if you have not done so already, as described here: https://github.com/telerik/UI-For-UWP/blob/development/CONTRIBUTING.md.

@VitalyKnyazev
Copy link
Contributor Author

VitalyKnyazev commented Jun 2, 2023

@ivan-todorov-progress Hi Ivan, the issue only happens for a bunch of production users and I never could reproduce it locally, so not sure what sample I can upload.

That functionality is quite "disconnected" from the main chart and only relates to trackball, I believe it is safe to patch and then in a few months we will see if the issue is gone (most likely) or we have another NRE somewhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants