From 652bfe227e9c94ef47d82c326c601e22b3bd5ad7 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Mon, 25 Sep 2023 17:24:26 +0200 Subject: [PATCH] fix: avoid calling function on null --- static-src/kx-claim.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static-src/kx-claim.js b/static-src/kx-claim.js index 4c7557a..e2800df 100644 --- a/static-src/kx-claim.js +++ b/static-src/kx-claim.js @@ -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) {