1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-04-02 08:33:31 +01:00

Fix unsafe non-null assertion on repos.find() in quick-bar My link creation

Handle case where repository is not found in store repositories (e.g., for local addons) by checking if repo exists before accessing its properties. This prevents TypeError when creating My links for local addons.
This commit is contained in:
Cursor Agent
2026-03-29 14:27:47 +00:00
parent f402dadf7b
commit ed2f570c97

View File

@@ -317,9 +317,9 @@ export default <T extends Constructor<HassElement>>(superClass: T) =>
fetchHassioAddonInfo(this.hass!, myParams.get("app")!),
fetchStoreRepositories(this.hass!),
]);
const repo = repos.find((r) => r.slug === info.repository)!;
const repo = repos.find((r) => r.slug === info.repository);
if (repo.source !== "local") {
if (repo && repo.source !== "local") {
myParams.append("repository_url", repo.source);
}
} else if (redirect.redirect === "/hassio/addon") {