diff --git a/src/types/settings.ts b/src/types/settings.ts index 1679e4e..35ea5ed 100644 --- a/src/types/settings.ts +++ b/src/types/settings.ts @@ -20,5 +20,10 @@ const smartCopilotSettingsSchema = z.object({ export type SmartCopilotSettings = z.infer export function parseSmartCopilotSettings(data: unknown): SmartCopilotSettings { - return smartCopilotSettingsSchema.parse(data) + try { + return smartCopilotSettingsSchema.parse(data) + } catch (error) { + console.warn('Invalid settings provided, using defaults:', error) + return smartCopilotSettingsSchema.parse({}) + } }