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

Bindings null-values cause crash #257

Open
TimofeyBurak opened this issue Mar 2, 2020 · 0 comments
Open

Bindings null-values cause crash #257

TimofeyBurak opened this issue Mar 2, 2020 · 0 comments
Labels
c/bindings Related to Bindings component.

Comments

@TimofeyBurak
Copy link
Contributor

Description

It would be more convenient if Bindings will use some kind of null-propagation: if one of the properties in the expression is null - then the value of the source would consider null

Steps to Reproduce

  1. Create ViewModel for screen
  2. Implement SubViewModel class with string Message
  3. Add property of type SubViewModel to screen ViewModel
  4. Set SubViewModel to null by default
  5. Apply binding like following
    this.Bind(() => ViewModel.SubViewModel.Message, () => Label.Text)

Expected Behavior

Source value (ViewModel.SubViewModel.Message) is interpreted as null, so target property (Label.Text) is set to null. Also, as SubViewModel value is changed - Binding should react and recalculate source value

Actual Behavior

NullReferenceException, as expression () => ViewModel.SubViewModel.Message is used to calculate source value

Basic Information

  • Version with issue: doesn't seem like we tracking versions, really.. latest master
  • Last known good version: none
  • IDE: JetBrains Rider 2019.3.3
  • Platform Target Frameworks:
    • iOS: 11.0
@wcoder wcoder added the c/bindings Related to Bindings component. label Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/bindings Related to Bindings component.
Projects
None yet
Development

No branches or pull requests

2 participants