fix: handle case where message id may not exist
This commit is contained in:
@@ -99,8 +99,10 @@ app.openapi(route, async (c) => {
|
||||
env<Env, typeof c>(c, "workerd"),
|
||||
titleId,
|
||||
);
|
||||
await client.messages.delete(messageId);
|
||||
await deleteTitleMessage(env<Env, typeof c>(c, "workerd"), titleId);
|
||||
if (messageId) {
|
||||
await client.messages.delete(messageId);
|
||||
await deleteTitleMessage(env<Env, typeof c>(c, "workerd"), titleId);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(new Error("Error setting watch status", { cause: error }));
|
||||
|
||||
Reference in New Issue
Block a user