diff --git a/wp-content/themes/pub/wporg-learn-2024/src/course-outline/index.js b/wp-content/themes/pub/wporg-learn-2024/src/course-outline/index.js index d8e60617e..941ac06ee 100644 --- a/wp-content/themes/pub/wporg-learn-2024/src/course-outline/index.js +++ b/wp-content/themes/pub/wporg-learn-2024/src/course-outline/index.js @@ -4,6 +4,10 @@ import { Icon, drafts, lockOutline } from '@wordpress/icons'; import { renderToString } from '@wordpress/element'; document.addEventListener( 'DOMContentLoaded', () => { + if ( ! wporgCourseOutlineData ) { + return; + } + wporgCourseOutlineData[ 'in-progress' ]?.forEach( ( title ) => { const lessonLinks = document.querySelectorAll( '.wp-block-sensei-lms-course-outline-lesson' ); lessonLinks.forEach( ( link ) => {