summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService/Bug.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-10-09 23:06:18 +0200
committerGitHub <noreply@github.com>2018-10-09 23:06:18 +0200
commit37d767c50d5ae69b13c47b71ba16b93c6b450730 (patch)
tree8d91a217f7350b68ea391b345b1a1a362a2ad2d6 /Bugzilla/WebService/Bug.pm
parent34fd0c3db18f7f5da558d8a8294e7fea61224186 (diff)
downloadbugzilla-37d767c50d5ae69b13c47b71ba16b93c6b450730.tar.gz
bugzilla-37d767c50d5ae69b13c47b71ba16b93c6b450730.tar.xz
Bug 1497343 - Add some rudimentary type checking to Bugzilla::WebServe::Util::validate()
Diffstat (limited to 'Bugzilla/WebService/Bug.pm')
-rw-r--r--Bugzilla/WebService/Bug.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index 9003f3480..61a95e07d 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -1462,7 +1462,8 @@ sub _bug_to_hash {
elsif ($field->type == FIELD_TYPE_DATETIME
|| $field->type == FIELD_TYPE_DATE)
{
- $item{$name} = $self->type('dateTime', $bug->$name);
+ my $value = $bug->$name;
+ $item{$name} = defined($value) ? $self->type('dateTime', $value) : undef;
}
elsif ($field->type == FIELD_TYPE_MULTI_SELECT) {
my @values = map { $self->type('string', $_) } @{ $bug->$name };