mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +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;
|
||||
}
|
||||
if (entityIdA.includes(".")) {
|
||||
entityIdA = entityRegistryByEntityId(entityRegistry)[entityIdA].id;
|
||||
const entityA = entityRegistryByEntityId(entityRegistry)[entityIdA];
|
||||
if (!entityA) {
|
||||
return false;
|
||||
}
|
||||
entityIdA = entityA.id;
|
||||
}
|
||||
if (entityIdB.includes(".")) {
|
||||
entityIdB = entityRegistryByEntityId(entityRegistry)[entityIdB].id;
|
||||
const entityB = entityRegistryByEntityId(entityRegistry)[entityIdB];
|
||||
if (!entityB) {
|
||||
return false;
|
||||
}
|
||||
entityIdB = entityB.id;
|
||||
}
|
||||
return entityIdA === entityIdB;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user