Skip to content

Commit 5df8e78

Browse files
committed
Fix empty relationships being None in LAYOUT_FIGURE
1 parent d272e0f commit 5df8e78

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

textractor/parsers/response_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ def _create_layout_objects(
752752
)
753753
)
754754
parsed_blocks.add(block["Id"])
755-
for relationship in block.get("Relationships", []):
755+
for relationship in (block.get("Relationships", []) or []):
756756
if relationship["Type"] != "CHILD":
757757
continue
758758
for leaf_id in relationship["Ids"]:
@@ -770,7 +770,7 @@ def _create_layout_objects(
770770
)
771771
)
772772
container_layouts[-1].children[-1].raw_object = block
773-
for relationship in block.get("Relationships", []):
773+
for relationship in (block.get("Relationships", []) or []):
774774
if relationship["Type"] != "CHILD":
775775
continue
776776
container_layouts[-1].children[-1].add_children(
@@ -789,7 +789,7 @@ def _create_layout_objects(
789789
)
790790
)
791791
leaf_layouts[-1].raw_object = block
792-
for relationship in block.get("Relationships", []):
792+
for relationship in (block.get("Relationships", []) or []):
793793
if relationship["Type"] != "CHILD":
794794
continue
795795
leaf_layouts[-1].add_children(

0 commit comments

Comments
 (0)