fix: avoid calling function on null

This commit is contained in:
Yarmo Mackenbach 2023-09-25 17:24:26 +02:00
parent 73dd948a33
commit 652bfe227e
No known key found for this signature in database
GPG key ID: 3C57D093219103A3

View file

@ -64,7 +64,9 @@ export class Claim extends HTMLElement {
root.querySelector('.info .title').innerText = claimJson.display.name;
root.querySelector('.info .subtitle').innerText = claimJson.display.serviceProviderName ??
(claim.status < 300 ? '???' : '---');
root.querySelector('.info img').setAttribute('src', `https://design.keyoxide.org/brands/service-providers/${claimJson.display.serviceProviderName.toLowerCase() || '_'}/icon.svg`);
root.querySelector('.info img').setAttribute('src',
`https://design.keyoxide.org/brands/service-providers/${claimJson.display.serviceProviderName
? claimJson.display.serviceProviderName.toLowerCase() : '_'}/icon.svg`);
try {
if (claim.status >= 200) {