1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-15 10:46:32 +00:00

fixed null attachment

This commit is contained in:
Nguyễn Việt Hưng
2018-05-19 18:58:44 +07:00
parent c9cb31bd02
commit 52f694a714

View File

@@ -172,7 +172,7 @@ function getAttachmentsInContent (markdownContent) {
* @returns {String[]} Absolute paths of the referenced attachments * @returns {String[]} Absolute paths of the referenced attachments
*/ */
function getAbsolutePathsOfAttachmentsInContent (markdownContent, storagePath) { function getAbsolutePathsOfAttachmentsInContent (markdownContent, storagePath) {
const temp = getAttachmentsInContent(markdownContent) const temp = getAttachmentsInContent(markdownContent) || []
const result = [] const result = []
for (const relativePath of temp) { for (const relativePath of temp) {
result.push(relativePath.replace(new RegExp(STORAGE_FOLDER_PLACEHOLDER, 'g'), path.join(storagePath, DESTINATION_FOLDER))) result.push(relativePath.replace(new RegExp(STORAGE_FOLDER_PLACEHOLDER, 'g'), path.join(storagePath, DESTINATION_FOLDER)))