]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Patch for bug 254729: fix editproducts.cgi generated warnings in the error log when...
authorjocuri%softhome.net <>
Thu, 9 Sep 2004 05:53:39 +0000 (05:53 +0000)
committerjocuri%softhome.net <>
Thu, 9 Sep 2004 05:53:39 +0000 (05:53 +0000)
editproducts.cgi

index 873db1afc4400483241476aad8954cc9be6951f9..4098274d0f8948ba8ca692444393913691f3c1dd 100755 (executable)
@@ -434,23 +434,25 @@ if ($action eq 'new') {
 
     my $existing_product = TestProduct($product);
 
-    # Check for exact case sensitive match:
-    if ($existing_product eq $product) {
-        print "The product '$product' already exists. Please press\n";
-        print "<b>Back</b> and try again.\n";
-        PutTrailer($localtrailer);
-        exit;
-    }
+    if ($existing_product) {
 
-    # Next check for a case-insensitive match:
-    if (lc($existing_product) eq lc($product)) {
-        print "The new product '$product' differs from existing product ";
-        print "'$existing_product' only in case. Please press\n";
-        print "<b>Back</b> and try again.\n";
-        PutTrailer($localtrailer);
-        exit;
-    }
+        # Check for exact case sensitive match:
+        if ($existing_product eq $product) {
+            print "The product '$product' already exists. Please press\n";
+            print "<b>Back</b> and try again.\n";
+            PutTrailer($localtrailer);
+            exit;
+        }
 
+        # Next check for a case-insensitive match:
+        if (lc($existing_product) eq lc($product)) {
+            print "The new product '$product' differs from existing product ";
+            print "'$existing_product' only in case. Please press\n";
+            print "<b>Back</b> and try again.\n";
+            PutTrailer($localtrailer);
+            exit;
+        }
+    }
 
     my $version = trim($::FORM{version} || '');