Hotfix: icourse163 (#1340)
修复 `TypeError: Cannot read property 'reduce' of null` 报错
This commit is contained in:
@@ -32,7 +32,7 @@ module.exports = async (ctx) => {
|
||||
lectors += `${lector.realName || lector.nickName}、`;
|
||||
return lectors;
|
||||
}, '');
|
||||
const tags = item.mocTagDtos.reduce((tags, tag) => {
|
||||
const tags = (item.mocTagDtos || []).reduce((tags, tag) => {
|
||||
tags += `${tag.name}、`;
|
||||
return tags;
|
||||
}, '');
|
||||
@@ -59,7 +59,7 @@ module.exports = async (ctx) => {
|
||||
${item.schoolPanel.name} ${lectors}<br>
|
||||
开课时间: ${startTimeString}<br><br>
|
||||
${media}
|
||||
${item.termPanel.jsonContent.replace('spContent=', '')}
|
||||
${(item.termPanel.jsonContent || '').replace('spContent=', '')}
|
||||
`;
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user