Skip to content

Commit 1a9cbc4

Browse files
fix: handle missing API key in getActiveProviderWithKey function
- Added a check to return null if the API key is not available, improving error handling in AI provider integration.
1 parent 738a6fd commit 1a9cbc4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

apps/desktop/src/lib/aiClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export async function getActiveProviderWithKey(
9393

9494
try {
9595
const apiKey = await getAIApiKey(config.provider);
96+
if (!apiKey) return null;
9697
return { provider: config.provider, apiKey };
9798
} catch {
9899
return null;

0 commit comments

Comments
 (0)