Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 3401bde

Browse files
committed
Make sure we don't pass null to ValidationError ctor
It doesn't allow nulls.
1 parent 00ea889 commit 3401bde

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/GitHub.UI.Reactive/Controls/Validation/ValidationMessage.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ void ShowValidateError(bool showError)
125125

126126
var bindingExpression = ValidatesControl.GetBindingExpression(TextBox.TagProperty);
127127
if (bindingExpression == null) return;
128-
var validationError = new ValidationError(
129-
new ExceptionValidationRule(),
130-
BindingOperations.GetBindingExpression(ValidatesControl, TextBox.TagProperty));
128+
var opExpression = BindingOperations.GetBindingExpression(ValidatesControl, TextBox.TagProperty);
129+
if (opExpression == null) return;
130+
var validationError = new ValidationError(new ExceptionValidationRule(), opExpression);
131131

132132
if (showError)
133133
{

0 commit comments

Comments
 (0)