From 18c3cfe07c37cda912785c9934db14cbac5a46f5 Mon Sep 17 00:00:00 2001 From: afsuyadi Date: Sat, 13 Jun 2026 07:39:17 +0700 Subject: [PATCH] fix(frontend): add guard against null model --- frontend/common/stores/project-store.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/common/stores/project-store.js b/frontend/common/stores/project-store.js index 8d74d0532461..454663134a54 100644 --- a/frontend/common/stores/project-store.js +++ b/frontend/common/stores/project-store.js @@ -176,8 +176,10 @@ const store = Object.assign({}, BaseStore, { getEnvironmentById: (id) => store.model && find(store.model.environments, { id }), getEnvironmentIdFromKey: (api_key) => { - const env = find(store.model.environments, { api_key }) - return env && env.id + if (store.model) { + const env = find(store.model.environments, { api_key }) + return env && env.id + } }, getEnvironmentIdFromKeyAsync: async (projectId, apiKey) => { if (store.model && `${store.model.id}` === `${projectId}`) {