-
Notifications
You must be signed in to change notification settings - Fork 137
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
Fix NullReferenceException
in ASP.NET Core when RoutePattern.RawText
is null
(#5880 -> v2)
#5888
Conversation
…xt` is `null` (#5880) ## Summary of changes Fix `NullReferenceException` in aspnetcore handler ## Reason for change `RoutePattern.RawText` can be null ## Implementation details Add `#nullable enable` annotation to the duck type, and `AspNetCoreResourceNameHelper` and follow the errors. ## Test coverage Covered by existing in general, hard to reproduce this specific bug <!--⚠️ Note: where possible, please obtain 2 approvals prior to merging. Unless CODEOWNERS specifies otherwise, for external teams it is typically best to have one review from a team member, and one review from apm-dotnet. Trivial changes do not require 2 reviews. -->
Datadog ReportBranch report: ✅ 0 Failed, 343486 Passed, 1763 Skipped, 14h 11m 38.6s Total Time ⌛ Performance Regressions vs Default Branch (14)
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing the following branches/commits: Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5888) - mean (74ms) : 63, 85
. : milestone, 74,
master - mean (73ms) : 63, 84
. : milestone, 73,
section CallTarget+Inlining+NGEN
This PR (5888) - mean (1,032ms) : 1011, 1052
. : milestone, 1032,
master - mean (1,068ms) : 1047, 1088
. : milestone, 1068,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5888) - mean (110ms) : 106, 115
. : milestone, 110,
master - mean (109ms) : 105, 114
. : milestone, 109,
section CallTarget+Inlining+NGEN
This PR (5888) - mean (724ms) : 706, 743
. : milestone, 724,
master - mean (748ms) : 725, 771
. : milestone, 748,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5888) - mean (93ms) : 89, 96
. : milestone, 93,
master - mean (92ms) : 90, 95
. : milestone, 92,
section CallTarget+Inlining+NGEN
This PR (5888) - mean (676ms) : 652, 700
. : milestone, 676,
master - mean (702ms) : 685, 719
. : milestone, 702,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5888) - mean (192ms) : 188, 196
. : milestone, 192,
master - mean (193ms) : 188, 198
. : milestone, 193,
section CallTarget+Inlining+NGEN
This PR (5888) - mean (1,129ms) : 1107, 1151
. : milestone, 1129,
master - mean (1,169ms) : 1137, 1200
. : milestone, 1169,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5888) - mean (277ms) : 273, 281
. : milestone, 277,
master - mean (276ms) : 272, 281
. : milestone, 276,
section CallTarget+Inlining+NGEN
This PR (5888) - mean (894ms) : 859, 928
. : milestone, 894,
master - mean (918ms) : 897, 939
. : milestone, 918,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (5888) - mean (267ms) : 263, 271
. : milestone, 267,
master - mean (266ms) : 262, 270
. : milestone, 266,
section CallTarget+Inlining+NGEN
This PR (5888) - mean (885ms) : 856, 913
. : milestone, 885,
master - mean (903ms) : 884, 921
. : milestone, 903,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me thanks!
Summary of changes
Fix
NullReferenceException
in aspnetcore handlerReason for change
RoutePattern.RawText
can be nullImplementation details
Add
#nullable enable
annotation to the duck type, andAspNetCoreResourceNameHelper
and follow the errors.Test coverage
Covered by existing in general, hard to reproduce this specific bug
Backport of #5880