Merge branch 'MDL-68099-master' of git://github.com/marinaglancy/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Tue, 26 May 2020 03:29:48 +0000 (11:29 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Tue, 26 May 2020 03:29:48 +0000 (11:29 +0800)
grade/report/lib.php

index 7d8f7ed..70be5da 100644 (file)
@@ -378,8 +378,9 @@ abstract class grade_report {
                 $this->currentgroup = -2; // means can not access any groups at all
             }
             if ($this->currentgroup) {
-                $group = groups_get_group($this->currentgroup);
-                $this->currentgroupname     = $group->name;
+                if ($group = groups_get_group($this->currentgroup)) {
+                    $this->currentgroupname = $group->name;
+                }
                 $this->groupsql             = " JOIN {groups_members} gm ON gm.userid = u.id ";
                 $this->groupwheresql        = " AND gm.groupid = :gr_grpid ";
                 $this->groupwheresql_params = array('gr_grpid'=>$this->currentgroup);