diff --git a/src/services/chat_service.py b/src/services/chat_service.py index 57f2bff..e563ca3 100644 --- a/src/services/chat_service.py +++ b/src/services/chat_service.py @@ -198,7 +198,13 @@ class ChatService: "answer": INIT_MESSAGES[0], } - applicant = application["applicants"][0] + try: + applicant = application["applicants"][0] + except: + return { + "session_id": session_id, + "answer": INIT_MESSAGES[2].format(name=name) + } if not applicant.get("gender") or not applicant.get("dob") or applicant.get("dob") == "-01-" or not applicant.get("weight") or applicant.get("heightFt") is None or applicant.get("heightIn") is None: return { "session_id": session_id,