summaryrefslogtreecommitdiffstats
path: root/Bugzilla/User.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/User.pm')
-rw-r--r--Bugzilla/User.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index 7c458388c..3e6f3b6ba 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -716,7 +716,14 @@ sub can_enter_product {
my $dbh = Bugzilla->dbh;
$warn ||= 0;
- if (!defined $input) {
+ $input = trim($input) if !ref $input;
+ if (!defined $input or $input eq '') {
+ return unless $warn == THROW_ERROR;
+ ThrowUserError('object_not_specified',
+ { class => 'Bugzilla::Product' });
+ }
+
+ if (!scalar @{ $self->get_enterable_products }) {
return unless $warn == THROW_ERROR;
ThrowUserError('no_products');
}