diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index cd87cba3..06dd2925 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -378,10 +378,10 @@ }) .catch((error) => { console.log(error); - toast.error(`OpenAI: ${error.error.message}`); + toast.error(`OpenAI: ${error?.error?.message ?? 'Network Problem'}`); return null; }); - const openaiModels = openaiModelRes.data; + const openaiModels = openaiModelRes?.data ?? null; if (openaiModels) { models = [