Skip to content

Bindings null-values cause crash #257

@TimofeyBurak

Description

@TimofeyBurak

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    c/bindingsRelated to Bindings component.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions