From 1b00a282fa1aae97b90e82ca3c38aac847606222 Mon Sep 17 00:00:00 2001 From: Devashish Khulbe Date: Thu, 8 Nov 2018 21:25:23 -0500 Subject: [PATCH] Update json_to_csv_converter.py --- json_to_csv_converter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/json_to_csv_converter.py b/json_to_csv_converter.py index 61c4f9cb..7d1585d3 100644 --- a/json_to_csv_converter.py +++ b/json_to_csv_converter.py @@ -83,7 +83,9 @@ def get_nested_value(d, key): if base_key not in d: return None sub_dict = d[base_key] - return get_nested_value(sub_dict, sub_key) + + if sub_dict is not None: + return get_nested_value(sub_dict, sub_key) def get_row(line_contents, column_names): """Return a csv compatible row given column names and a dict."""