updated a bit

This commit is contained in:
u-e 2018-12-20 13:25:14 +03:00
parent 65c92982b1
commit 2b950da441

View File

@ -60,9 +60,9 @@ const postImage = (metaData, body) => {
if (metaData && metaData.image && metaData.image[0]) {
imageLink = metaData.image[0];
} else if (markdownImageRegex.test(body)) {
} else if (body && markdownImageRegex.test(body)) {
const markdownMatch = body.match(markdownImageRegex);
if (markdownMatch) {
if (markdownMatch[0]) {
const firstMarkdownMatch = markdownMatch[0];
imageLink = firstMarkdownMatch.match(urlRegex)[0];
}