Skip to content

Commit cdd94c6

Browse files
kindle: fix possible crash when not connected to a network but wifi is on (koreader#15519)
1 parent 33b7143 commit cdd94c6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

frontend/device/kindle/device.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,8 @@ function Kindle:initNetworkManager(NetworkMgr)
500500
signal_level = string.format("%d/%d", network.signal, network.signal_max),
501501
signal_quality = qualities[network.signal],
502502
-- See comment above about netid being unfortunately optional...
503-
connected = (current_profile.netid and current_profile.netid ~= -1 and current_profile.netid == network.netid)
504-
or (current_profile.netid == nil and current_profile.essid ~= "" and current_profile.essid == network.essid),
503+
connected = current_profile and ((current_profile.netid and current_profile.netid ~= -1 and current_profile.netid == network.netid)
504+
or (current_profile.netid == nil and current_profile.essid ~= "" and current_profile.essid == network.essid)),
505505
flags = network.key_mgmt,
506506
ssid = network.essid ~= "" and network.essid,
507507
password = password,

0 commit comments

Comments
 (0)