From 1350aaa02745c614a52cf3462b2598432b009744 Mon Sep 17 00:00:00 2001 From: Bronson Oka Date: Mon, 9 Nov 2020 10:52:53 -1000 Subject: [PATCH] fix: images in private messages check for post.content before replacing body --- modules/ept-images/plugins/images.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/ept-images/plugins/images.js b/modules/ept-images/plugins/images.js index 23aecc2c..d78efad7 100644 --- a/modules/ept-images/plugins/images.js +++ b/modules/ept-images/plugins/images.js @@ -114,7 +114,12 @@ images.imageSub = (post) => { return images.saveImage(imgSrc) .then(function(savedUrl) { if (savedUrl) { - post.body = post.body.replace(imgSrc, savedUrl); + if (post.content) { + post.content.body = post.content.body.replace(imgSrc, savedUrl); + } + else { + post.body = post.body.replace(imgSrc, savedUrl); + } } }); })