From cd9b3e10fd93e5b8a34db619f6a1ece97a1bd4b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Fern=C3=A1ndez?= <975883+pazos@users.noreply.github.com> Date: Sun, 27 Dec 2020 14:10:06 +0100 Subject: [PATCH] calibre: do not attempt to stop the socket if nil (#7067) --- plugins/calibre.koplugin/wireless.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/calibre.koplugin/wireless.lua b/plugins/calibre.koplugin/wireless.lua index cfd5b7305..1a3aece1b 100644 --- a/plugins/calibre.koplugin/wireless.lua +++ b/plugins/calibre.koplugin/wireless.lua @@ -255,10 +255,14 @@ end function CalibreWireless:disconnect() logger.info("disconnect from calibre") self.connect_message = false - self.calibre_socket:stop() - UIManager:removeZMQ(self.calibre_messagequeue) - self.calibre_socket = nil - self.calibre_messagequeue = nil + if self.calibre_socket then + self.calibre_socket:stop() + self.calibre_socket = nil + end + if self.calibre_messagequeue then + UIManager:removeZMQ(self.calibre_messagequeue) + self.calibre_messagequeue = nil + end CalibreMetadata:clean() end