Empty items could still slipped in when converting string to array.
authorAtsushi Eno <atsushieno@veritas-vos-liberabit.com>
Fri, 29 Nov 2013 09:55:54 +0000 (18:55 +0900)
committerAtsushi Eno <atsushieno@veritas-vos-liberabit.com>
Fri, 29 Nov 2013 09:55:54 +0000 (18:55 +0900)
ResolveAssemblyReferences was hit with empty SearchPaths because of this.

mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildEngine4.cs

index 77d3d436a35543cad5ef49235feebf0325506b22..a892e8831e968432eedd389e145f33051e0b93be 100644 (file)
@@ -373,7 +373,7 @@ namespace Microsoft.Build.Internal
                        if (targetType == typeof(ITaskItem) || targetType.IsSubclassOf (typeof(ITaskItem)))
                                return new TargetOutputTaskItem () { ItemSpec = WindowsCompatibilityExtensions.NormalizeFilePath (source.Trim ()) };
                        if (targetType.IsArray)
-                               return new ArrayList (source.Split (';').Where (s => !string.IsNullOrEmpty (s)).Select (s => ConvertTo (s.Trim (), targetType.GetElementType ())).ToArray ())
+                               return new ArrayList (source.Split (';').Select (s => s.Trim ()).Where (s => !string.IsNullOrEmpty (s)).Select (s => ConvertTo (s, targetType.GetElementType ())).ToArray ())
                                                .ToArray (targetType.GetElementType ());
                        if (targetType == typeof(bool)) {
                                switch (source != null ? source.ToLower (CultureInfo.InvariantCulture) : string.Empty) {