Skip to content

Commit ac3a1bc

Browse files
author
Marko Petzold
committed
fix: handle null and undefined values for needleValue in rendering
1 parent a1e817d commit ac3a1bc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/widget-value.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,9 @@ export class WidgetValue extends LitElement {
378378
?active=${this.textActive}
379379
style="color: ${this.themeTitleColor}"
380380
>
381-
${isNaN(ds.needleValue ?? 0) || ds.needleValue === undefined
381+
${ds.needleValue === undefined ||
382+
ds.needleValue === null ||
383+
isNaN(ds.needleValue)
382384
? ''
383385
: ds.needleValue.toFixed(Math.max(0, ds.precision ?? 0))}
384386
<span class="unit paging" ?active=${this.textActive}>${ds.unit}</span>

0 commit comments

Comments
 (0)