[MS.Build] skip null string entry as input to string.Join().
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 14 May 2014 09:21:05 +0000 (18:21 +0900)
committerAtsushi Eno <atsushieno@gmail.com>
Thu, 15 May 2014 14:55:19 +0000 (23:55 +0900)
mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildEngine4.cs

index f260b3c0982dcdb625944920f6367ec39fa2832a..444b3867da0d5f68b290618d78195c3bacee149b 100644 (file)
@@ -337,7 +337,7 @@ namespace Microsoft.Build.Internal
                                                valueInstance = ConvertTo (p.Value, prop.PropertyType);
                                                prop.SetValue (task, valueInstance, null);
                                        } else if (p.Value.Any ()) {
-                                               string valueString = string.Join (";", p.Value.Where (o => o != null).Select (o => ConvertTo (o, typeof (string))));
+                                               string valueString = string.Join (";", p.Value.Where (o => o != null).Select (o => ConvertTo (o, typeof (string))).Where (s => s != null));
                                                if (string.IsNullOrEmpty (valueString) && !requiredProps.Contains (prop))
                                                        continue;
                                                valueInstance = ConvertTo (valueString, prop.PropertyType);