]> 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:19:00 +0000 (03:19 +0000)
committerlpsolit%gmail.com <>
Thu, 11 Jan 2007 03:19:00 +0000 (03:19 +0000)
importxml.pl

index 8f93ab46cf2b24c2c526e232a1f87f291429333b..bd10e654031a5f4b5b1a9f856ebc58f05604d3de 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
@@ -692,8 +693,13 @@ sub process_bug {
 
     # Milestone
     if ( $params->{"usetargetmilestone"} ) {
-        my $milestone = new Bugzilla::Milestone(
-            { product => $product, name => $bug_fields{'target_milestone'} });
+        my $milestone;
+        if (defined $bug_fields{'target_milestone'}
+            && $bug_fields{'target_milestone'} ne "") {
+
+            $milestone = new Bugzilla::Milestone(
+                { product => $product, name => $bug_fields{'target_milestone'} });
+        }
         if ($milestone) {
             push( @values, $milestone->name );
         }