Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions openedx/core/djangoapps/content/search/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from openedx.core.djangoapps.content.search.models import IncrementalIndexCompleted, get_access_ids_for_request
from openedx.core.djangoapps.content_libraries import api as lib_api
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError

from .documents import (
Fields,
Expand Down Expand Up @@ -278,6 +279,9 @@ def _recurse_children(block, fn, status_cb: Callable[[str], None] | None = None)
for child_id in block.children:
try:
child = block.get_child(child_id)
if child is None:
# XBlocks with XModuleMixin will return None from get_child() instead of raising an exception :/
raise ItemNotFoundError(f"block.get_child() from {block.usage_key} failed to load child {child_id}")
except Exception as err: # pylint: disable=broad-except
log.exception(err)
if status_cb is not None:
Expand Down
Loading