Skip to content

Commit

Permalink
Error generated if none of the comments have a userid associated with…
Browse files Browse the repository at this point in the history
… them (which shouldn't happen anyway...)
  • Loading branch information
davosmith committed Oct 13, 2010
1 parent 58880b3 commit c45366b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,10 @@ function view_items($viewother = false, $userreport = false) {
$commentuserids[] = $comment->commentby;
}
}
$commentuserids = implode(",",array_unique($commentuserids, SORT_NUMERIC));
$commentusers = get_records_select('user', 'id IN ('.$commentuserids.')');
if (!empty($commentuserids)) {
$commentuserids = implode(",",array_unique($commentuserids, SORT_NUMERIC));
$commentusers = get_records_select('user', 'id IN ('.$commentuserids.')');
}
} else {
$comments = false;
}
Expand Down

0 comments on commit c45366b

Please sign in to comment.