diff --git a/lib/navigationlib.php b/lib/navigationlib.php
index 9f22f184cea..22e00b4abe6 100644
--- a/lib/navigationlib.php
+++ b/lib/navigationlib.php
@@ -434,7 +434,7 @@ class navigation_node implements renderable {
     public function build_flat_navigation_list(flat_navigation $nodes, $showdivider = false) {
         if ($this->showinflatnavigation) {
             $indent = 0;
-            if ($this->type == self::TYPE_COURSE || $this->key == self::COURSE_INDEX_PAGE) {
+            if ($this->type == self::TYPE_COURSE || $this->key === self::COURSE_INDEX_PAGE) {
                 $indent = 1;
             }
             $flat = new flat_navigation_node($this, $indent);