diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 4b89160d8a9..5c1245e1767 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -4025,8 +4025,8 @@ class settings_navigation extends navigation_node { $function($this, $modulenode); - // Remove the module node if there are no children - if (empty($modulenode->children)) { + // Remove the module node if there are no children. + if ($modulenode->children->count() <= 0) { $modulenode->remove(); }