Commit eed17219 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Handle the case when no results are returned.

parent 3b17eeee
......@@ -43,15 +43,17 @@ $offset = param_integer('offset', 0);
$data = search_user($query, $limit, $offset);
foreach ($data['data'] as &$result) {
$result->name = display_name($result);
unset($result->email);
unset($result->institution);
unset($result->username);
unset($result->firstname);
unset($result->lastname);
unset($result->preferredname);
if ($data['data']) {
foreach ($data['data'] as &$result) {
$result->name = display_name($result);
unset($result->email);
unset($result->institution);
unset($result->username);
unset($result->firstname);
unset($result->lastname);
unset($result->preferredname);
}
}
json_headers();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment