fix: handle empty class list in logo image scanner
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

img.get('class') can return an empty list [], causing IndexError
when accessing [0]. Added `or ['']` fallback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-02-20 19:05:32 +01:00
parent 44d8ab932b
commit f8bb0be16b

View File

@ -384,7 +384,7 @@ class LogoFetchService:
for img in soup.find_all('img'):
attrs_text = ' '.join([
img.get('class', [''])[0] if isinstance(img.get('class'), list) else str(img.get('class', '')),
(img.get('class', ['']) or [''])[0] if isinstance(img.get('class'), list) else str(img.get('class', '')),
img.get('id', ''),
img.get('alt', ''),
img.get('src', '')