mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 17:56:46 +00:00
Guard against unknown entities in automation compare functions (#25213)
Guard against unknown entities
This commit is contained in:
parent
f65a0ef4f7
commit
0242fbc6f8
@ -167,10 +167,18 @@ const compareEntityIdWithEntityRegId = (
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (entityIdA.includes(".")) {
|
if (entityIdA.includes(".")) {
|
||||||
entityIdA = entityRegistryByEntityId(entityRegistry)[entityIdA].id;
|
const entityA = entityRegistryByEntityId(entityRegistry)[entityIdA];
|
||||||
|
if (!entityA) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
entityIdA = entityA.id;
|
||||||
}
|
}
|
||||||
if (entityIdB.includes(".")) {
|
if (entityIdB.includes(".")) {
|
||||||
entityIdB = entityRegistryByEntityId(entityRegistry)[entityIdB].id;
|
const entityB = entityRegistryByEntityId(entityRegistry)[entityIdB];
|
||||||
|
if (!entityB) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
entityIdB = entityB.id;
|
||||||
}
|
}
|
||||||
return entityIdA === entityIdB;
|
return entityIdA === entityIdB;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user