]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1461400 - Log errors in webservices when undef values are passed to $self->type()
authorDylan William Hardison <dylan@hardison.net>
Wed, 23 May 2018 13:10:55 +0000 (09:10 -0400)
committerGitHub <noreply@github.com>
Wed, 23 May 2018 13:10:55 +0000 (09:10 -0400)
Bugzilla/WebService/Server/XMLRPC.pm

index fce865e8882abdeac98202040e7b402f569dbafd..6bb73af0106816ca47aad3a4bbba002e8b09eb9d 100644 (file)
@@ -11,6 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
+use Bugzilla::Logging;
 use XMLRPC::Transport::HTTP;
 use Bugzilla::WebService::Server;
 if ($ENV{MOD_PERL}) {
@@ -32,8 +33,15 @@ BEGIN {
         if ($type eq 'dateTime') {
             # This is the XML-RPC implementation,  see the README in Bugzilla/WebService/.
             # Our "base" implementation is in Bugzilla::WebService::Server.
-            $value = Bugzilla::WebService::Server->datetime_format_outbound($value);
-            $value =~ s/-//g;
+            if (defined $value) {
+                $value = Bugzilla::WebService::Server->datetime_format_outbound($value);
+                $value =~ s/-//g;
+            }
+            else {
+                my ($pkg, $file, $line) = caller;
+                my $class = ref $self;
+                ERROR("$class->type($type, undef) called from $pkg ($file line $line)");
+            }
         }
         elsif ($type eq 'email') {
             $type = 'string';