* Delete.cs (Execute): Skip non-existant files.
authorAnkit Jain <radical@corewars.org>
Tue, 27 Jan 2009 12:58:38 +0000 (12:58 -0000)
committerAnkit Jain <radical@corewars.org>
Tue, 27 Jan 2009 12:58:38 +0000 (12:58 -0000)
svn path=/trunk/mcs/; revision=124655

mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Delete.cs

index 31d53433d87a63ea2d1d7949dfa782a38810303e..b8088b1715e58e44d4d57073a6f619de3594371f 100644 (file)
@@ -1,3 +1,7 @@
+2009-01-27  Ankit Jain  <jankit@novell.com>
+
+       * Delete.cs (Execute): Skip non-existant files.
+
 2009-01-06  Ankit Jain  <jankit@novell.com>
 
        * CreateManifestResourceName.cs (Execute): Use full path, also helps
index c53360f0f888155893bcb72285ce10f0e93e496b..4b6ad28ee5b96f06b92acabb1b7bd7199c47e1d5 100644 (file)
@@ -50,13 +50,15 @@ namespace Microsoft.Build.Tasks {
                        List <ITaskItem> temporaryDeletedFiles = new List <ITaskItem> ();
                
                        foreach (ITaskItem file in files) {
+                               string path = file.GetMetadata ("FullPath");
+                               if (path == null || !File.Exists (path))
+                                       //skip
+                                       continue;
+
                                try {
-                                       File.Delete (file.GetMetadata ("FullPath"));
+                                       File.Delete (path);
                                        temporaryDeletedFiles.Add (file);
                                }
-                               catch (ArgumentNullException ex) {
-                                       LogException (ex);
-                               }
                                catch (ArgumentException ex) {
                                        LogException (ex);
                                }