fix: handle missing message in assistant generation telemetry (#6528)

This commit is contained in:
Thomas authored and ajnart committed 2026-08-13 19:56:41 +02:00
1 parent c6cf75e561
commit 73b7df44d7
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -738,7 +738,7 @@ export const assistantRouter = createTRPCRouter({
}),
getConfigurationAsync(ctx.db),
]);
if (!message) throw new TRPCError({ code: "NOT_FOUND", message: "Message not found." });
if (!message) return { complete: true, generations: [] };
if (configuration?.provider !== "openrouter" || !configuration.encryptedApiKey) {
return { complete: true, generations: [] };
}