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
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:
parent
44d8ab932b
commit
f8bb0be16b
@ -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', '')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user