]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
no bug - Fix Triage Owner list throwing if predefined product is not found
authorKohei Yoshino <kohei.yoshino@gmail.com>
Wed, 10 Apr 2019 13:38:45 +0000 (09:38 -0400)
committerGitHub <noreply@github.com>
Wed, 10 Apr 2019 13:38:45 +0000 (09:38 -0400)
extensions/BMO/lib/Reports/Triage.pm

index d19f459e8a3bc4e67050d945d313bf7253ceccb4..6e78ba3b28ae7bdd24f9c570d0e2c6857159f792 100644 (file)
@@ -57,11 +57,9 @@ sub unconfirmed {
         ? $input->{'component'}
         : [$input->{'component'}];
       foreach my $component_name (@$ra_components) {
-        my $component
-          = Bugzilla::Component->new({name => $component_name, product => $product})
-          || ThrowUserError('invalid_object',
-          {object => 'Component', value => $component_name});
-        push @component_ids, $component->id;
+        next unless my $component = Bugzilla::Component->new(
+          {name => $component_name, product => $product, cache => 1});
+        push(@component_ids, $component->id);
       }
     }
 
@@ -261,7 +259,8 @@ sub owners {
     my @product_names
       = $input->{product} ? ($input->{product}) : DEFAULT_OWNER_PRODUCTS;
     foreach my $name (@product_names) {
-      push(@products, Bugzilla::Product->check({name => $name}));
+      next unless my $product = Bugzilla::Product->new({name => $name, cache => 1});
+      push(@products, $product);
     }
   }
 
@@ -272,9 +271,9 @@ sub owners {
       ? $input->{'component'}
       : [$input->{'component'}];
     foreach my $component_name (@$ra_components) {
-      my $component = Bugzilla::Component->check(
-        {name => $component_name, product => $products[0]});
-      push @component_ids, $component->id;
+      next unless my $component = Bugzilla::Component->new(
+        {name => $component_name, product => $products[0], cache => 1});
+      push(@component_ids, $component->id);
     }
   }