update plugins/genshin/apps/exchange.js.

关联 issue #I8TCD0
处理对象少参数导致 #原神兑换码 指令无法继续处理或者输出后续内容的问题

Signed-off-by: Anno_Lawl <749927099@qq.com>
This commit is contained in:
Anno_Lawl 2024-01-04 07:38:13 +00:00 committed by Gitee
parent b659655dca
commit 6c636b0401
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 11 additions and 1 deletions

View File

@ -110,7 +110,17 @@ export class exchange extends plugin {
}
for (const p of ret.data.list) {
const post = p.post.post;
//新增 #原神兑换码 异常捕捉,防止存在多个活动时因为异常报错导致无法继续处理或者输出后续内容
let post;
try{
const posts = p.post.post;
post = posts;
}catch (e) {
logger.error(e);
post = null;
}
//end 2024-1-4
if (!post) {
continue;
}