Skip to content

Commit 7acd789

Browse files
fix: handle null api key
1 parent 7f33252 commit 7acd789

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/apikey.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export function isValidAPIKey(apiKey: string | null) {
2-
return apiKey.startsWith("sk-") || apiKey.startsWith("sk-proj-");
2+
return apiKey != null && (apiKey.startsWith("sk-") || apiKey.startsWith("sk-proj-"));
33
}

0 commit comments

Comments
 (0)