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:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user