diff --git a/common/lib/xmodule/xmodule/library_content_module.py b/common/lib/xmodule/xmodule/library_content_module.py index fd58beaeeaf2613d0777e8be9d79d7e006693ecb..d796e870c3bc65d3a653055911e73d1147654cf6 100644 --- a/common/lib/xmodule/xmodule/library_content_module.py +++ b/common/lib/xmodule/xmodule/library_content_module.py @@ -315,6 +315,15 @@ class LibraryContentModule(LibraryContentFields, XModule, StudioEditableModule): child_context = {} if not context else copy(context) for child in self._get_selected_child_blocks(): + if child is None: + # TODO: Fix the underlying issue in TNL-7424 + # This shouldn't be happening, but does for an as-of-now + # unknown reason. Until we address the underlying issue, + # let's at least log the error explicitly, ignore the + # exception, and prevent the page from resulting in a + # 500-response. + logger.error('Skipping display for child block that is None') + continue for displayable in child.displayable_items(): rendered_child = displayable.render(STUDENT_VIEW, child_context) fragment.add_fragment_resources(rendered_child)