-
Notifications
You must be signed in to change notification settings - Fork 468
Open
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
Current Behavior
Assume an Entry with the Flags property set to ValidateOnAttaching and Text bound to a nullable string property.
When loading the page view, an ArgumentNullException is thrown.
System.ArgumentNullException: Value cannot be null. (Parameter 'value')
at System.ArgumentNullException.Throw(String paramName)
at System.ArgumentNullException.ThrowIfNull(Object argument, String paramName)
at CommunityToolkit.Maui.Behaviors.NumericValidationBehavior.ValidateAsync(String value, CancellationToken token) in /_/src/CommunityToolkit.Maui/Behaviors/Validators/NumericValidationBehavior.shared.cs:line 79
at CommunityToolkit.Maui.Behaviors.ValidationBehavior`1[[System.String, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ValidateAsync(Object value, CancellationToken token) in /_/src/CommunityToolkit.Maui/Behaviors/Validators/ValidationBehavior.shared.cs:line 463
at CommunityToolkit.Maui.Behaviors.ValidationBehavior.UpdateStateAsync(VisualElement view, ValidationFlags flags, Boolean isForced, Nullable`1 parentToken) in /_/src/CommunityToolkit.Maui/Behaviors/Validators/ValidationBehavior.shared.cs:line 382
Expected Behavior
- No exception
IsValidset toFalse
Steps To Reproduce
- Open the project in the linked repository
- Run the application in the Android emulator
- Observe the exception being thrown on the loading of MainPage
Link to public reproduction project repository
https://github.com/Niels-R/ExceptionExample
Environment
- .NET MAUI CommunityToolkit: 13.0.0
- OS: macOS Tahoe 26.0.1 (25A362)
- .NET MAUI: 10.0.11Anything else?
This bug has been reported before, but without a working sample to reproduce.