Skip to content

Commit e40fd6f

Browse files
author
Marko Petzold
committed
fix: enhance needleValue validation to handle null and undefined cases
1 parent c134737 commit e40fd6f

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
@@ -354,7 +354,9 @@ export class WidgetValue extends LitElement {
354354
?active=${this.textActive}
355355
style="color: ${this.themeTitleColor}"
356356
>
357-
${isNaN(ds.needleValue ?? 0) || ds.needleValue === undefined
357+
${ds.needleValue === undefined ||
358+
ds.needleValue === null ||
359+
isNaN(ds.needleValue)
358360
? ''
359361
: ds.needleValue.toFixed(Math.max(0, ds.precision ?? 0))}
360362
<span class="unit paging" ?active=${this.textActive}>${ds.unit}</span>

0 commit comments

Comments
 (0)