DeutscheMark / homebridge-kodi

Kodi plugin for Homebridge
MIT License
28 stars 4 forks source link

Update index.js rPI Null Value Errors #2

Closed moedje closed 4 years ago

moedje commented 4 years ago

// On OSMC rPi the below was returning an null value error so added null value handling as done with unknown result.item.type below // let speed = result.speed != 0; let speed = result.speed != 0 ? result.speed : 0; // let percentage = Math.round(result.percentage); let percentage = result.percentage != 0 ? result.percentage : 0; percentage = Math.round(percentage);

I am not a JS dev though so struggling my way around this stuff just know Python and Kodi stuff.

I still get errors but not related to null value now, TypeError: Cannot read property 'getCharacteristic' of undefined at connection.kodiRequest.then.result (/usr/lib/node_modules/homebridge-kodi/index.js:302:42) at processTicksAndRejections (internal/process/task_queues.js:86:5)

DeutscheMark commented 4 years ago

Thanks, I optimized the null checks in v0.1.3.