From 6b44ea63fbc6f3bacf07098c73c5078d16a4fe63 Mon Sep 17 00:00:00 2001
From: Alexey Lunin <alexey.lunin@vereign.com>
Date: Wed, 15 Apr 2020 08:23:10 +0300
Subject: [PATCH] Added checking the case when txtBody and htmlBody is passed
 but they are empty (User left blank email. Roundcube version)

---
 javascript/src/iframe/viamapi-iframe.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/javascript/src/iframe/viamapi-iframe.js b/javascript/src/iframe/viamapi-iframe.js
index f96df4b..3e55cef 100644
--- a/javascript/src/iframe/viamapi-iframe.js
+++ b/javascript/src/iframe/viamapi-iframe.js
@@ -1566,7 +1566,7 @@ const connection = Penpal.connectToParent({
         parts = [];
       }
 
-      if (htmlBody) {
+      if (htmlBody || htmlBody === "") {
         if (typeof htmlBody !== "string") {
           throw new Error("htmlBody is not string"); // should not happen
         }
@@ -1583,7 +1583,7 @@ const connection = Penpal.connectToParent({
         });
       }
 
-      if (textBody) {
+      if (textBody || textBody === "") {
         if (typeof textBody !== "string") {
           throw new Error("textBody is not string"); // should not happen
         }
-- 
GitLab