Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[regression/8.0.0-rc.2.9373] MultiBinding Throwing Object reference not set to an instance of an object. #18123

Closed
cgp1976 opened this issue Oct 19, 2023 · 3 comments
Assignees
Labels
area-xaml XAML, CSS, Triggers, Behaviors fixed-in-8.0.10 fixed-in-8.0.100-rc.2.9530 Look for this fix in 8.0.100-rc.2.9530 high It doesn't work at all, crashes or has a big impact. i/regression This issue described a confirmed regression on a currently supported version platform/windows 🪟 t/bug Something isn't working
Milestone

Comments

@cgp1976
Copy link

cgp1976 commented Oct 19, 2023

Description

I am getting the following error

at Microsoft.Maui.Controls.MultiBinding.Apply(Object context, BindableObject targetObject, BindableProperty targetProperty, Boolean fromBindingContextChanged, SetterSpecificity specificity)
at Microsoft.Maui.Controls.BindableObject.RemoveBinding(BindableProperty property, BindablePropertyContext context, SetterSpecificity specificity)
at Microsoft.Maui.Controls.BindableObject.RemoveBinding(BindableProperty property, SetterSpecificity specificity)
at Microsoft.Maui.Controls.Setter.UnApply(BindableObject target, SetterSpecificity specificity)
at Microsoft.Maui.Controls.TriggerBase.OnConditionChanged(BindableObject bindable, Boolean oldValue, Boolean newValue)
at Microsoft.Maui.Controls.BindingCondition.OnBoundPropertyChanged(BindableObject bindable, Object oldValue, Object newValue)
at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent)
at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity)
at Microsoft.Maui.Controls.BindingExpression.ApplyCore(Object sourceObject, BindableObject target, BindableProperty property, Boolean fromTarget, SetterSpecificity specificity)
at Microsoft.Maui.Controls.BindingExpression.Apply(Boolean fromTarget)
at Microsoft.Maui.Controls.BindingExpression.BindingExpressionPart.b__50_0()
at Microsoft.Maui.Controls.DispatcherExtensions.DispatchIfRequired(IDispatcher dispatcher, Action action)
at Microsoft.Maui.Controls.BindingExpression.BindingExpressionPart.PropertyChanged(Object sender, PropertyChangedEventArgs args)
at Microsoft.Maui.Controls.BindingExpression.WeakPropertyChangedProxy.OnPropertyChanged(Object sender, PropertyChangedEventArgs e)
at Microsoft.Maui.Controls.BindableObject.OnPropertyChanged(String propertyName)
at MauiApp3333.ViewModel.set_Mode(String value) in XXXXXXXXXXXXXXXX\MauiApp3333\MauiApp3333\MainPage.xaml.cs:line 15

MauiApp3333.zip

Steps to Reproduce

  1. Run the project
  2. Click on Button Edit
  3. Click on Button Cancel <-- over here will throw the error

Expected Behavior

  1. After Clicking Button Edit

  2. Button Edit Text Change to Submit

  3. Button Delete Text Change to Cancel

  4. After Clicking Button Cancel

  5. Button Cancel Text Change to Delete

  6. Button Submit Text Change to Edit

Link to public reproduction project repository

No response

Version with bug

8.0.0-rc.2.9373

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.0-rc.1.9171

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@cgp1976 cgp1976 added the t/bug Something isn't working label Oct 19, 2023
@jsuarezruiz jsuarezruiz added the area-xaml XAML, CSS, Triggers, Behaviors label Oct 19, 2023
@jsuarezruiz
Copy link
Contributor

cc @StephaneDelcroix

@samhouts samhouts added potential-regression This issue described a possible regression on a currently supported version., verification pending high It doesn't work at all, crashes or has a big impact. labels Oct 19, 2023
@samhouts samhouts added this to the .NET 8 GA milestone Oct 19, 2023
@samhouts samhouts changed the title MultiBinding Throwing Object reference not set to an instance of an object. [regression/8.0.0] MultiBinding Throwing Object reference not set to an instance of an object. Oct 20, 2023
@samhouts samhouts changed the title [regression/8.0.0] MultiBinding Throwing Object reference not set to an instance of an object. [regression/8.0.0-rc.2.9373] MultiBinding Throwing Object reference not set to an instance of an object. Oct 24, 2023
@samhouts
Copy link
Member

Confirmed that this regressed in 8.0.0-rc.2.9373. #17230 is likely culprit, @StephaneDelcroix

@samhouts samhouts added i/regression This issue described a confirmed regression on a currently supported version and removed potential-regression This issue described a possible regression on a currently supported version., verification pending labels Oct 24, 2023
StephaneDelcroix added a commit that referenced this issue Oct 27, 2023
Avoid NRE on reapplying.

- fixes #18123
@StephaneDelcroix
Copy link
Contributor

I can repro in a unittest, not related to #17320

@PureWeen PureWeen modified the milestones: .NET 8 GA, .NET 8 SR1 Oct 27, 2023
PureWeen pushed a commit that referenced this issue Oct 27, 2023
Avoid NRE on reapplying.

- fixes #18123
@github-project-automation github-project-automation bot moved this from Todo to Done in MAUI SDK Ongoing Oct 27, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 26, 2023
@samhouts samhouts added the fixed-in-8.0.100-rc.2.9530 Look for this fix in 8.0.100-rc.2.9530 label Jan 31, 2024
@samhouts samhouts modified the milestones: .NET 8 SR1, .NET 8 SR3 Jul 1, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area-xaml XAML, CSS, Triggers, Behaviors fixed-in-8.0.10 fixed-in-8.0.100-rc.2.9530 Look for this fix in 8.0.100-rc.2.9530 high It doesn't work at all, crashes or has a big impact. i/regression This issue described a confirmed regression on a currently supported version platform/windows 🪟 t/bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

5 participants