* (Apollon77) Fix crash cases reported by Sentry (IOBROKER-HASS-2)

This commit is contained in:
Ingo Fischer
2022-03-29 08:59:10 +02:00
parent 4096826099
commit dc47f48004
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -383,7 +383,7 @@ function main() {
}
if (entity.attributes) {
for (const attr in entity.attributes) {
if (!entity.attributes.hasOwnProperty(attr) || attr === 'friendly_name' || attr === 'unit_of_measurement' || attr === 'icon') {
if (!entity.attributes.hasOwnProperty(attr) || attr === 'friendly_name' || attr === 'unit_of_measurement' || attr === 'icon'|| !attr.length) {
continue;
}
let val = entity.attributes[attr];