From bd27e64cd846c72db90937c7e0fafa64712ec5df Mon Sep 17 00:00:00 2001 From: Gae24 <96017547+Gae24@users.noreply.github.com> Date: Thu, 10 Oct 2024 11:49:24 +0200 Subject: [PATCH] fix possible IndexError (#33750) Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> --- python/tidy/tidy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tidy/tidy.py b/python/tidy/tidy.py index 88e92b80922..247e74a8713 100644 --- a/python/tidy/tidy.py +++ b/python/tidy/tidy.py @@ -470,7 +470,7 @@ def validate_dependency_licenses(): error_fields = error['fields'] if error['type'] == 'summary': num_license_errors = error_fields['licenses']['errors'] - elif 'graphs' in error_fields: + elif 'graphs' in error_fields and error_fields['graphs']: crate = error_fields['graphs'][0]['Krate'] license_name = error_fields['notes'][0] message = f'Rejected license "{license_name}". Run `cargo deny` for more details'