Merge pull request #799 from kebby/master
[mono.git] / mcs / class / corlib / System.Threading.Tasks / Task.cs
index 1ae5559957ee710ce4206daf00fb0532f1df6987..5eefcb7da5f87592bc67d2751e579f0b95ed1055 100644 (file)
@@ -1082,6 +1082,9 @@ namespace System.Threading.Tasks
 
                internal static Task<TResult[]> WhenAllCore<TResult> (IList<Task<TResult>> tasks)
                {
+                       if (tasks.Count == 0)
+                               return FromResult(new TResult[0]);
+
                        foreach (var t in tasks) {
                                if (t == null)
                                        throw new ArgumentException ("tasks", "the tasks argument contains a null element");