Skip to content

Commit

Permalink
MDL-58539 assignfeedback_editpdf: Fix group assignment fatal error.
Browse files Browse the repository at this point in the history
This makes sure that $grade->attemptnumber is not NULL before using its
value.
  • Loading branch information
kabalin authored and dmonllao committed Apr 17, 2017
1 parent f14510d commit 231a80c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mod/assign/feedback/editpdf/locallib.php
Expand Up @@ -58,7 +58,7 @@ public function get_name() {
*/
public function get_widget($userid, $grade, $readonly) {
$attempt = -1;
if ($grade) {
if ($grade && isset($grade->attemptnumber)) {
$attempt = $grade->attemptnumber;
} else {
$grade = $this->assignment->get_user_grade($userid, true);
Expand Down

0 comments on commit 231a80c

Please sign in to comment.