From 5d89fab5e9e02025402e1be4ebcdfff91f214b68 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Tue, 9 Aug 2016 12:45:46 -0700 Subject: [PATCH] fix data transfer with empty html strings --- lib/utils/transfer.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/utils/transfer.js b/lib/utils/transfer.js index 6bfaf92fc..b98c247c3 100644 --- a/lib/utils/transfer.js +++ b/lib/utils/transfer.js @@ -128,7 +128,11 @@ class Transfer { getHtml() { if ('html' in this.cache) return this.cache.html - const html = this.data.getData('text/html') + let html + const string = this.data.getData('text/html') + + if (string != '') html = string + this.cache.html = html return html } @@ -162,7 +166,11 @@ class Transfer { getText() { if ('text' in this.cache) return this.cache.text - const text = this.data.getData('text/plain') + let text + const string = this.data.getData('text/plain') + + if (string != '') text = string + this.cache.text = text return text }