]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 348281: importxml.pl dies if there is no target milestone or the target milestone...
authorlpsolit%gmail.com <>
Thu, 11 Jan 2007 03:21:12 +0000 (03:21 +0000)
committerlpsolit%gmail.com <>
Thu, 11 Jan 2007 03:21:12 +0000 (03:21 +0000)
importxml.pl

index 82582f78d7100b8a1b5ab8f6f46708c75708cbbb..4a7b1f75e91c058bd5570619df58353b9cfd9d77 100755 (executable)
@@ -21,6 +21,7 @@
 # Contributor(s): Dawn Endico <endico@mozilla.org>
 #                 Gregary Hendricks <ghendricks@novell.com>
 #                 Vance Baarda <vrb@novell.com>
+#                 Guzman Braso <gbn@hqso.net>
 
 # This script reads in xml bug data from standard input and inserts
 # a new bug into bugzilla. Everything before the beginning <?xml line
@@ -730,9 +731,14 @@ sub process_bug {
 
     # Milestone
     if ( Param("usetargetmilestone") ) {
-        my $milestone =
-          new Bugzilla::Milestone( $product->id,
-                                   $bug_fields{'target_milestone'} );
+        my $milestone;
+        if (defined $bug_fields{'target_milestone'} 
+            && $bug_fields{'target_milestone'} ne "") {
+
+            $milestone =
+              new Bugzilla::Milestone( $product->id,
+                                       $bug_fields{'target_milestone'} );
+        }
         if ($milestone) {
             push( @values, $milestone->name );
         }