From 622d62c26f26928f3d18adeed219b08e396f3464 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 28 Sep 2020 15:18:46 +0100 Subject: [PATCH] Check that message exists --- daemon.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/daemon.py b/daemon.py index 8105804b..ab4450ed 100644 --- a/daemon.py +++ b/daemon.py @@ -5648,10 +5648,13 @@ class PubServer(BaseHTTPRequestHandler): self._benchmarkGETtimings(GETstartTime, GETtimings, 'show status done', 'show inbox html') - msg = msg.encode('utf-8') - self._set_headers('text/html', len(msg), - cookie, callingDomain) - self._write(msg) + + if msg: + msg = msg.encode('utf-8') + self._set_headers('text/html', len(msg), + cookie, callingDomain) + self._write(msg) + if GETstartTime: self._benchmarkGETtimings(GETstartTime, GETtimings, 'show status done',