Skip to content

Commit

Permalink
Merge pull request #220 from GreatFireWall/master
Browse files Browse the repository at this point in the history
Fix ArgumentNullException issue.
  • Loading branch information
jogibear9988 authored Feb 22, 2020
2 parents e9df2d9 + 843b935 commit 6200cab
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 6200cab

Please sign in to comment.