Skip to content

Commit

Permalink
Fix ArgumentNullException issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
greatfirewall committed Feb 22, 2020
1 parent e9df2d9 commit 843b935
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ICSharpCode.AvalonEdit/Search/SearchPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,15 @@ void ValidateSearchText()
{
if (searchTextBox == null)
return;

var be = searchTextBox.GetBindingExpression(TextBox.TextProperty);

try {
Validation.ClearInvalid(be);
if (be != null)
Validation.ClearInvalid(be);

UpdateSearch();

} catch (SearchPatternException ex) {
var ve = new ValidationError(be.ParentBinding.ValidationRules[0], be, ex.Message, ex);
Validation.MarkInvalid(be, ve);
Expand Down

0 comments on commit 843b935

Please sign in to comment.