From ed2f570c97687cfe90fd14a94763df76e0dddee0 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 29 Mar 2026 14:27:47 +0000 Subject: [PATCH] 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. --- src/state/quick-bar-mixin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/state/quick-bar-mixin.ts b/src/state/quick-bar-mixin.ts index 1b2650fb3d..e45a2ffe50 100644 --- a/src/state/quick-bar-mixin.ts +++ b/src/state/quick-bar-mixin.ts @@ -317,9 +317,9 @@ export default >(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") {