Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't attempt to add responses for users that don't exist
  • Loading branch information
aolley committed Feb 24, 2013
1 parent 9a378af commit 5f8279a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tab_responses.php
Expand Up @@ -70,10 +70,11 @@ function block_poll_get_response_checks($options, $selected) {
$table->width = '*';

foreach ($responses as $response) {
$user = $DB->get_record('user', array('id' => $response->userid), user_picture::fields());
$table->data[] = array_merge(array($OUTPUT->user_picture($user, array($cid)),
fullname($user), userdate($response->submitted)),
block_poll_get_response_checks($options, $response->optionid));
if ($user = $DB->get_record('user', array('id' => $response->userid), user_picture::fields())) {
$table->data[] = array_merge(array($OUTPUT->user_picture($user, array($cid)),
fullname($user), userdate($response->submitted)),
block_poll_get_response_checks($options, $response->optionid));
}
}

echo html_writer::table($table);
Expand Down

0 comments on commit 5f8279a

Please sign in to comment.