From 011bd2a17423e4b79c805e82947bdde438f22108 Mon Sep 17 00:00:00 2001 From: Neil Deshmukh Date: Tue, 3 Dec 2024 19:09:04 -0500 Subject: [PATCH] add null check --- prettyprinter/textractprettyprinter/t_pretty_print_layout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prettyprinter/textractprettyprinter/t_pretty_print_layout.py b/prettyprinter/textractprettyprinter/t_pretty_print_layout.py index b0f997bc..f6a48e3b 100644 --- a/prettyprinter/textractprettyprinter/t_pretty_print_layout.py +++ b/prettyprinter/textractprettyprinter/t_pretty_print_layout.py @@ -168,7 +168,7 @@ def _dfs(self, root, id2block): yield combined_text if block["BlockType"].startswith('LAYOUT') and block["BlockType"] not in ["LAYOUT_TITLE", "LAYOUT_SECTION_HEADER"]: - if "Relationships" in block: + if "Relationships" in block and block["Relationships"] is not None: relationships = block["Relationships"] children = [(x, depth + 1) for x in relationships[0]['Ids']] stack.extend(reversed(children))