fix(middleware): simplecc null description (#8053)

This commit is contained in:
Tony 2022-01-23 02:59:10 +07:00 committed by GitHub
parent 202d457f23
commit eb2037c5d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -235,8 +235,8 @@ module.exports = async (ctx, next) => {
// opencc
if (ctx.query.opencc) {
ctx.state.data.item.forEach((item) => {
item.title = simplecc(item.title, ctx.query.opencc);
item.description = simplecc(item.description, ctx.query.opencc);
item.title = simplecc(item.title ?? item.link, ctx.query.opencc);
item.description = simplecc(item.description ?? item.title ?? item.link, ctx.query.opencc);
});
}