diff --git a/renderer.php b/renderer.php
index f20219ad385b54f586ec16fd4f83fe7b1f102ef2..4d69459da83686f32ed80dc729c3b3f28e615405 100644
--- a/renderer.php
+++ b/renderer.php
@@ -533,7 +533,7 @@ foreach ($htmlsection as $section) {
 	}
 
 	$titre = $nameSection[$i];
-	$sectionIntro = $introSection[$i];
+	$sectionIntro = isset($introSection[$i]) ? $introSection[$i] : '';
 				//If section is hidden continue
 	if ($titre == null && !(has_capability('moodle/course:update', $context = context_course::instance($COURSE->id), $USER->id))) {
 		$i++;
@@ -777,7 +777,7 @@ public function print_iena_section_pages($course)
 				// }
 				/* if is not editing verify the rules to display the sections */
 				if (!$PAGE->user_is_editing() && (!has_capability('moodle/course:viewhiddensections', $context = context_course::instance($course->id), $USER->id))) {
-					if ($course->hiddensections && !(int)$thissection->visible) {
+					if (isset($course->hiddensections) && $course->hiddensections && !(int)$thissection->visible) {
 						continue;
 					}
 					if (!$thissection->available && !empty($thissection->availableinfo)) {