summaryrefslogtreecommitdiffstats
path: root/Bugzilla/API
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/API')
-rw-r--r--Bugzilla/API/1_0/Server.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/Bugzilla/API/1_0/Server.pm b/Bugzilla/API/1_0/Server.pm
index ed147dc2a..6136440cf 100644
--- a/Bugzilla/API/1_0/Server.pm
+++ b/Bugzilla/API/1_0/Server.pm
@@ -89,6 +89,16 @@ sub handle {
# Execute the handler
my $result = $self->_handle;
+ # The result needs to be a valid JSON data structure
+ # and not a undefined or scalar value.
+ if (!ref $result
+ || blessed($result)
+ || ref $result ne 'HASH'
+ || ref $result ne 'ARRAY')
+ {
+ $result = { result => $result };
+ }
+
$self->response($result);
}