Hotfix: icourse163 (#1340)

修复 `TypeError: Cannot read property 'reduce' of null` 报错
This commit is contained in:
凉凉
2019-01-08 19:32:13 +08:00
committed by DIYgod
parent 189a1dcd97
commit 739a5ee235
+2 -2
View File
@@ -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 {