From ac7b6aaab5b520d810ff1c8a4fbebf89138b2f97 Mon Sep 17 00:00:00 2001 From: lucarota Date: Wed, 7 Aug 2019 12:41:05 +0200 Subject: [PATCH] Fix: Zsync -> Subscribe to book share crashes (#5184) Patch similar to PR #3086. Same problem #2638 when tap Subscribe to book share. "Zsync" -> "Subscribe to book share" crashes koreader if not connected to wifi After this fix when koreader is offline after "Zsync" -> "Subscribe to book share" we are asked to enable wifi. --- plugins/zsync.koplugin/main.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/zsync.koplugin/main.lua b/plugins/zsync.koplugin/main.lua index 020994d30..fe8cc5d9e 100644 --- a/plugins/zsync.koplugin/main.lua +++ b/plugins/zsync.koplugin/main.lua @@ -62,6 +62,11 @@ function ZSync:addToMainMenu(menu_items) return self.filemq_server == nil end, callback = function() + local NetworkMgr = require("ui/network/manager") + if not NetworkMgr:isOnline() then + NetworkMgr:promptWifiOn() + return + end if not self.filemq_client then self:subscribe() else