diff --git a/src/adaptors/api/vuepress/vuepressYamlConverterAdaptor.ts b/src/adaptors/api/vuepress/vuepressYamlConverterAdaptor.ts index 5a0076f6..54419cad 100644 --- a/src/adaptors/api/vuepress/vuepressYamlConverterAdaptor.ts +++ b/src/adaptors/api/vuepress/vuepressYamlConverterAdaptor.ts @@ -92,7 +92,7 @@ class VuepressYamlConverterAdaptor extends YamlConvertAdaptor { } // 日记 - if (post.title.includes("[日记]")) { + if (post?.title?.includes("[日记]")) { yamlFormatObj.yamlObj.article = false } diff --git a/src/adaptors/base/baseExtendApi.ts b/src/adaptors/base/baseExtendApi.ts index 6866a96f..8ac75c47 100644 --- a/src/adaptors/base/baseExtendApi.ts +++ b/src/adaptors/base/baseExtendApi.ts @@ -164,7 +164,7 @@ class BaseExtendApi extends WebApi implements IBlogApi, IWebApi { const post = _.cloneDeep(doc) as Post if (cfg?.mdFilenameRule) { - if (cfg?.mdFilenameRule.includes("[filename]")) { + if (cfg?.mdFilenameRule?.includes("[filename]")) { cfg.useMdFilename = true } // 处理文件规则 @@ -237,7 +237,7 @@ class BaseExtendApi extends WebApi implements IBlogApi, IWebApi { const pathCates = [] // 笔记层级作为文件路径 - if (savePath.includes(CATE_AUTO_NAME)) { + if (savePath?.toString().includes(CATE_AUTO_NAME)) { cfg.usePathCategory = true } // 获取笔记层级