protection for no language

This commit is contained in:
mrT23
2023-09-17 16:41:53 +03:00
parent ea91a38541
commit 4fbe7d14b5
2 changed files with 9 additions and 0 deletions

View File

@ -132,6 +132,10 @@ def get_main_pr_language(languages, files) -> str:
Get the main language of the commit. Return an empty string if cannot determine.
"""
main_language_str = ""
if not languages:
logging.info("No languages detected")
return main_language_str
try:
top_language = max(languages, key=languages.get).lower()