Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: add null guard for topicId to fix type error

Arvin Xu2b44cdd29850
diff --git a/src/server/routers/lambda/task.ts b/src/server/routers/lambda/task.ts
index bd521bf36ca..b595f3de0d3 100644
--- a/src/server/routers/lambda/task.ts
+++ b/src/server/routers/lambda/task.ts
@@ -1239,7 +1239,7 @@ export const taskRouter = router({
const aiAgentService = new AiAgentService(ctx.serverDB, ctx.userId);
for (const t of topics) {
- if (t.status !== 'running') continue;
+ if (t.status !== 'running' || !t.topicId) continue;
// Interrupt the remote operation first; if it fails, skip cancellation
// to avoid desynchronizing DB state from a still-running operation.