Merge branch 'MDL-73732-master' of https://github.com/sharidas/moodle

This commit is contained in:
Shamim Rezaie 2022-03-01 01:04:19 +11:00
commit 625218e0f1

View File

@ -4042,9 +4042,11 @@ class flat_navigation_node extends navigation_node {
if ($this->is_section()) {
$active = $PAGE->navigation->find_active_node();
while ($active = $active->parent) {
if ($active->key == $this->key && $active->type == $this->type) {
return true;
if ($active) {
while ($active = $active->parent) {
if ($active->key == $this->key && $active->type == $this->type) {
return true;
}
}
}
}