From 5a76abe721b587cb0ca72daa598bc9bf0e60127f Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Tue, 26 Aug 2025 19:31:19 +0200 Subject: [PATCH] webapp: Make compiler happy --- webapp/src/components/InputSerial.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/webapp/src/components/InputSerial.vue b/webapp/src/components/InputSerial.vue index 0bfbba74..e51bd863 100644 --- a/webapp/src/components/InputSerial.vue +++ b/webapp/src/components/InputSerial.vue @@ -105,9 +105,12 @@ export default defineComponent({ let sn_int: bigint = 0n; for (let i = 0; i < 9; i++) { - const pos: bigint = BigInt(chars32.indexOf(sn[i].toUpperCase())); - const shift: bigint = BigInt(42 - 5 * i - (i <= 2 ? 0 : 2)); - sn_int |= pos << shift; + const c = sn[i]; + if (typeof c === 'string') { + const pos: bigint = BigInt(chars32.indexOf(c.toUpperCase())); + const shift: bigint = BigInt(42 - 5 * i - (i <= 2 ? 0 : 2)); + sn_int |= pos << shift; + } } return sn_int.toString(16);