2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00

calibre: do not attempt to stop the socket if nil (#7067)

This commit is contained in:
Martín Fernández 2020-12-27 14:10:06 +01:00 committed by GitHub
parent 0685eecdad
commit cd9b3e10fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -255,10 +255,14 @@ end
function CalibreWireless:disconnect() function CalibreWireless:disconnect()
logger.info("disconnect from calibre") logger.info("disconnect from calibre")
self.connect_message = false self.connect_message = false
self.calibre_socket:stop() if self.calibre_socket then
UIManager:removeZMQ(self.calibre_messagequeue) self.calibre_socket:stop()
self.calibre_socket = nil self.calibre_socket = nil
self.calibre_messagequeue = nil end
if self.calibre_messagequeue then
UIManager:removeZMQ(self.calibre_messagequeue)
self.calibre_messagequeue = nil
end
CalibreMetadata:clean() CalibreMetadata:clean()
end end