MDL-31077 REST server should return null if nothing fail and if the description function return null.

This commit is contained in:
Jerome Mouneyrac
2012-01-17 15:50:37 +08:00
parent f70f6e9ad1
commit 4bc3f5a2da
+5 -1
View File
@@ -85,7 +85,11 @@ class webservice_rest_server extends webservice_base_server {
//Check that the returned values are valid
try {
$validatedvalues = external_api::clean_returnvalue($this->function->returns_desc, $this->returns);
if ($this->function->returns_desc != null) {
$validatedvalues = external_api::clean_returnvalue($this->function->returns_desc, $this->returns);
} else {
$validatedvalues = null;
}
} catch (Exception $ex) {
$exception = $ex;
}