From 07a71a56ade7496ff944304e2925d2fc7e2e802f Mon Sep 17 00:00:00 2001 From: Jacob Manning Date: Wed, 10 Mar 2021 19:26:26 -0500 Subject: [PATCH] Add check for missing conversation_state --- parser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parser.py b/parser.py index 8df5903..1c60fad 100644 --- a/parser.py +++ b/parser.py @@ -238,6 +238,10 @@ def main(file_path): LOG_INFO('Parsing JSON file: {}'.format(file_path)) json_archive = json.load(f) + if not 'conversation_state' in json_archive.keys(): + LOG_ERROR('Could not find `conversation_state` in file {}'.format(file_path)) + return + # Parse each conversation for state in json_archive['conversation_state']: conv = Conversation(state)