Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

gracefully handle null values in BindingExpression.TryConvert #15382

Merged
merged 1 commit into from
Jun 1, 2022

Conversation

thisisthekap
Copy link
Contributor

@thisisthekap thisisthekap commented May 23, 2022

Description of Change

Added null handling to BindingExpression.TryConvert to mitigate an NullReferenceException which thereafter leads to app crash in production.

Issues Resolved

API Changes

None

Platforms Affected

  • Core/XAML (all platforms)

Behavioral/Visual Changes

None

Before/After Screenshots

Not applicable

Testing Procedure

None

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@jfversluis
Copy link
Member

Hey @thisisthekap thanks for this PR! I'm kind of on the fence about this one. I see how this makes sense, on the other hand you might want to include that null check earlier in your own code?

But even more so, this is technically a breaking change since this changes the behavior of how it has always worked.

Copy link
Member

@StephaneDelcroix StephaneDelcroix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as it only happens from time to time in prod, and you can't reproduce, I can't say if the attempted fix will solve your problem, or if you won't have another issue later on. but the fix is safe, I don't see any reasons not to merge it

@jfversluis
Copy link
Member

jfversluis commented May 31, 2022

/azp run

@azure-pipelines

This comment was marked as outdated.

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jfversluis
Copy link
Member

Verified on our non-public pipeline that this builds

@jfversluis jfversluis merged commit b2d70cd into xamarin:5.0.0 Jun 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Crash with NullReferenceException in Xamarin.Forms.BindingExpression.TryConvert on iOS
3 participants