Skip to content

Commit

Permalink
MDL-31077 REST server should return null if nothing fail and if the d…
Browse files Browse the repository at this point in the history
…escription function return null.
  • Loading branch information
mouneyrac committed Jan 17, 2012
1 parent f70f6e9 commit 4bc3f5a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion webservice/rest/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ protected function send_response() {

//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;
}
Expand Down

0 comments on commit 4bc3f5a

Please sign in to comment.