Skip to content

Commit 3804108

Browse files
committed
[#151] Successfully convert if file contains an empty activity
1 parent e4a8c7a commit 3804108

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

flattentool/json_input.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ def parse(self):
9393
else:
9494
root_json_list = path_search(self.root_json_dict, self.root_list_path.split('/'))
9595
for json_dict in root_json_list:
96+
if json_dict is None:
97+
# This is particularly useful for IATI XML, in order to not
98+
# fallover on empty activity, e.g. <iati-activity/>
99+
continue
96100
self.parse_json_dict(json_dict, sheet=self.main_sheet)
97101

98102
def parse_json_dict(self, json_dict, sheet, json_key=None, parent_name='', flattened_dict=None, parent_id_fields=None, top_level_of_sub_sheet=False):

0 commit comments

Comments
 (0)