Skip to content
Snippets Groups Projects
Commit 3da9362a authored by stvn's avatar stvn
Browse files

Log and skip empty children when rendering library_content

instead of throwing an exception on None-access.
parent 63567122
Branches
Tags
No related merge requests found
......@@ -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)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment