build: 修复无标签时的编译问题

This commit is contained in:
tangly1024
2022-03-25 15:21:00 +08:00
parent d515f33dcf
commit 320133cb59

View File

@@ -79,7 +79,7 @@ export async function getStaticProps ({ params: { slug } }) {
function getRecommendPost (post, allPosts, count = 6) {
let recommendPosts = []
const postIds = []
const currentTags = post.tags
const currentTags = post.tags || []
for (let i = 0; i < allPosts.length; i++) {
const p = allPosts[i]
if (p.id === post.id || p.type.indexOf('Post') < 0) {