From 1d5c0e09edbca198ee9751814aa14d8fac2be27b Mon Sep 17 00:00:00 2001 From: Tom Bocklisch Date: Tue, 6 Oct 2020 15:31:22 +0200 Subject: [PATCH] check for key when guessing line number. fixes #6937 --- rasa/shared/utils/validation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rasa/shared/utils/validation.py b/rasa/shared/utils/validation.py index 808fac0fcc08..0828fd351be9 100644 --- a/rasa/shared/utils/validation.py +++ b/rasa/shared/utils/validation.py @@ -104,7 +104,7 @@ def _line_number_for_path(self, current: Any, path: Text) -> Optional[int]: head, tail = path, "" if head: - if isinstance(current, dict): + if isinstance(current, dict) and head in current: return self._line_number_for_path(current[head], tail) or this_line elif isinstance(current, list) and head.isdigit(): return self._line_number_for_path(current[int(head)], tail) or this_line