In some cases when trying to create tests, metagpt crashes.

Adding some more safeguard to handle the case where code_doc is None.
This commit is contained in:
Arnaud Gelas 2024-01-16 21:44:45 +01:00
parent 75cbf9f087
commit 03012a81fd

View file

@ -63,6 +63,8 @@ class QaEngineer(Role):
if not filename or "test" in filename:
continue
code_doc = await src_file_repo.get(filename)
if not code_doc:
continue
test_doc = await tests_file_repo.get("test_" + code_doc.filename)
if not test_doc:
test_doc = Document(