From 4c0b82a68d0c56a5b3ffdff53e20dd255fecf6a4 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 19 Aug 2016 00:37:39 +0200 Subject: [PATCH] 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. --- src/Avalonia.Controls/TextBox.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/TextBox.cs b/src/Avalonia.Controls/TextBox.cs index 5552d3d3c5..1003fef85f 100644 --- a/src/Avalonia.Controls/TextBox.cs +++ b/src/Avalonia.Controls/TextBox.cs @@ -503,7 +503,9 @@ namespace Avalonia.Controls private static IEnumerable UnpackException(Exception exception) { var aggregate = exception as AggregateException; - return aggregate == null ? Enumerable.Repeat(exception, 1) : aggregate.InnerExceptions; + return aggregate == null ? + (IEnumerable)new[] { exception } : + aggregate.InnerExceptions; } private int CoerceCaretIndex(int value)