diff --git a/src/plone/restapi/blocks_linkintegrity.py b/src/plone/restapi/blocks_linkintegrity.py index 754f5c256b..dc5343ff1d 100644 --- a/src/plone/restapi/blocks_linkintegrity.py +++ b/src/plone/restapi/blocks_linkintegrity.py @@ -69,9 +69,8 @@ def __init__(self, context, request): def __call__(self, block): value = (block or {}).get(self.field, []) children = iterate_children(value or []) - for child in children: - node_type = child.get("type") + node_type = child.get("type", "") if node_type: handler = getattr(self, f"handle_{node_type}", None) if handler: diff --git a/src/plone/restapi/deserializer/blocks.py b/src/plone/restapi/deserializer/blocks.py index 59e26a807c..e4a8f825be 100644 --- a/src/plone/restapi/deserializer/blocks.py +++ b/src/plone/restapi/deserializer/blocks.py @@ -24,9 +24,10 @@ def iterate_children(value): queue = deque(value) while queue: child = queue.pop() - yield child - if child.get("children"): - queue.extend(child["children"] or []) + if isinstance(child, dict): + yield child + if child.get("children", []): + queue.extend(child["children"] or []) @implementer(IFieldDeserializer)