[xbuild] Throw ArgumentNullException if target name is null
authorAnkit Jain <radical@corewars.org>
Fri, 11 Mar 2011 12:52:05 +0000 (18:22 +0530)
committerAnkit Jain <radical@corewars.org>
Fri, 11 Mar 2011 13:16:20 +0000 (18:46 +0530)
mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs

index 6e7971deb7a180d7e4efa22094243bc87f8cd9b2..3a8d2feda0b8d7afd7dffdf8c31c9ce07091f4c1 100644 (file)
@@ -351,9 +351,13 @@ namespace Microsoft.Build.BuildEngine {
                                initialTargetsBuilt = true;
                        }
 
-                       foreach (string target in targetNames)
+                       foreach (string target in targetNames) {
+                               if (target == null)
+                                       throw new ArgumentNullException ("Target name cannot be null");
+
                                if (!BuildTarget (target.Trim (), targetOutputs))
                                        return false;
+                       }
                                
                        return true;
                }