ioBroker / ioBroker.vis-2

Next generation visualisation for ioBroker platform.
Other
26 stars 3 forks source link

[bug]: Basic - Bulb -> Vis-2-View and Editor crashes if Datapoint is NULL #414

Open gBonfire opened 1 month ago

gBonfire commented 1 month ago

No existing issues.

Describe the bug

If the Datapoint you use is NULL then the following Errors occoured (Console - F12): react-dom.production.min.js:189 TypeError: Cannot read properties of null (reading 'toString') at c.isFalse (BasicBulb.tsx:198:27) at c.renderWidgetBody (BasicBulb.tsx:230:28) at c.render (visBaseWidget.tsx:1857:31) at c.render (visRxWidget.tsx:1028:22) at Ls (react-dom.production.min.js:204:189) at bs (react-dom.production.min.js:203:149) at Ci (react-dom.production.min.js:292:172) at xl (react-dom.production.min.js:280:389) at zl (react-dom.production.min.js:280:320) at gl (react-dom.production.min.js:280:180)

react-dom.production.min.js:283 Uncaught TypeError: Cannot read properties of null (reading 'toString') at c.isFalse (BasicBulb.tsx:198:27) at c.renderWidgetBody (BasicBulb.tsx:230:28) at c.render (visBaseWidget.tsx:1857:31) at c.render (visRxWidget.tsx:1028:22) at Ls (react-dom.production.min.js:204:189) at bs (react-dom.production.min.js:203:149) at Ci (react-dom.production.min.js:292:172) at xl (react-dom.production.min.js:280:389) at zl (react-dom.production.min.js:280:320) at gl (react-dom.production.min.js:280:180)

-> The View (and Editor) do not load correct an gets emtpy

To Reproduce

Create a empty Datapoint (null) Configure a Basic-Bulb on/off - Widget to use this Datapoint Refresh the Editor or load the View in Viewer.

Expected behavior

In my opinion: Null should handled like 0/false

Screenshots & Logfiles

TypeError: Cannot read properties of null (reading 'toString') at c.isFalse (BasicBulb.tsx:198:27) at c.renderWidgetBody (BasicBulb.tsx:230:28) at c.render (visBaseWidget.tsx:1857:31) at c.render (visRxWidget.tsx:1028:22) at Ls (react-dom.production.min.js:204:189) at bs (react-dom.production.min.js:203:149) at Ci (react-dom.production.min.js:292:172) at xl (react-dom.production.min.js:280:389) at zl (react-dom.production.min.js:280:320) at gl (react-dom.production.min.js:280:180)

Uncaught TypeError: Cannot read properties of null (reading 'toString') at c.isFalse (BasicBulb.tsx:198:27) at c.renderWidgetBody (BasicBulb.tsx:230:28) at c.render (visBaseWidget.tsx:1857:31) at c.render (visRxWidget.tsx:1028:22) at Ls (react-dom.production.min.js:204:189) at bs (react-dom.production.min.js:203:149) at Ci (react-dom.production.min.js:292:172) at xl (react-dom.production.min.js:280:389) at zl (react-dom.production.min.js:280:320) at gl (react-dom.production.min.js:280:180)

Page or affected widget

Basis - Bulb on/off

Adapter version

VIS-2 2.9.47

js-controller version

5.0.19

Node version

v18.17.1

Operating system

Ubuntu 22.04.3 LTS

Additional context

-