summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Keyword.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Keyword.pm')
-rw-r--r--Bugzilla/Keyword.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/Bugzilla/Keyword.pm b/Bugzilla/Keyword.pm
index 882adaf02..e2ecc29e5 100644
--- a/Bugzilla/Keyword.pm
+++ b/Bugzilla/Keyword.pm
@@ -35,8 +35,6 @@ use constant DB_COLUMNS => qw(
use constant DB_TABLE => 'keyworddefs';
-use constant REQUIRED_CREATE_FIELDS => qw(name description);
-
use constant VALIDATORS => {
name => \&_check_name,
description => \&_check_description,
@@ -106,7 +104,9 @@ sub _check_name {
my ($self, $name) = @_;
$name = trim($name);
- $name eq "" && ThrowUserError("keyword_blank_name");
+ if (!defined $name or $name eq "") {
+ ThrowUserError("keyword_blank_name");
+ }
if ($name =~ /[\s,]/) {
ThrowUserError("keyword_invalid_name");
}
@@ -124,7 +124,9 @@ sub _check_name {
sub _check_description {
my ($self, $desc) = @_;
$desc = trim($desc);
- $desc eq '' && ThrowUserError("keyword_blank_description");
+ if (!defined $desc or $desc eq '') {
+ ThrowUserError("keyword_blank_description");
+ }
return $desc;
}