Browse Source

Always use an IList (array) for DataValidationErrors.

It's dangerous to pass a non-collection IEnumerable to an ItemsControl
and will be made illegal at some point.
pull/691/head
Steven Kirk 10 years ago
parent
commit
4c0b82a68d
  1. 4
      src/Avalonia.Controls/TextBox.cs

4
src/Avalonia.Controls/TextBox.cs

@ -503,7 +503,9 @@ namespace Avalonia.Controls
private static IEnumerable<Exception> UnpackException(Exception exception)
{
var aggregate = exception as AggregateException;
return aggregate == null ? Enumerable.Repeat(exception, 1) : aggregate.InnerExceptions;
return aggregate == null ?
(IEnumerable<Exception>)new[] { exception } :
aggregate.InnerExceptions;
}
private int CoerceCaretIndex(int value)

Loading…
Cancel
Save