From 232492b57e80ddf4bc83aaf0b60de8043c03f11d Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 22 Dec 2013 01:26:36 +0200 Subject: [PATCH] Fix bug #1206886: only write to the socket if it exists --- openlp/plugins/bibles/lib/db.py | 2 +- openlp/plugins/remotes/lib/httpserver.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 3def6bc3e..b5ce83471 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -1061,7 +1061,7 @@ class OldBibleDB(QtCore.QObject, Manager): QtCore.QObject.__init__(self) if u'path' not in kwargs: raise KeyError(u'Missing keyword argument "path".') - if u'file' not in kwargs: + if u'file' not in kwargs: raise KeyError(u'Missing keyword argument "file".') if u'path' in kwargs: self.path = kwargs[u'path'] diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index db49bed96..3b2da6949 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -593,8 +593,11 @@ class HttpConnection(object): for header, value in response.headers.iteritems(): http += '%s: %s\r\n' % (header, value) http += '\r\n' - self.socket.write(http) - self.socket.write(response.content) + if self.socket: + # Write to the socket if it's open, else ignore it. + # See http://support.openlp.org/scp/tickets.php?id=2112 + self.socket.write(http) + self.socket.write(response.content) def disconnected(self): """