Fix syntax

This commit is contained in:
Mel-kior
2021-09-10 00:23:41 +02:00
committed by Frans de Jonge
parent 3001efb85f
commit 9e55e4da3d
2 changed files with 3 additions and 3 deletions

View File

@@ -59,7 +59,7 @@ end
--- Authenticates network.
function WpaSupplicant:authenticateNetwork(network)
local err, wcli, nw_id
wcli, err = WpaClient.new(self.wpa_supplicant.ctrl_interface)
if not wcli then
return false, T(CLIENT_INIT_ERR_MSG, err)
@@ -74,7 +74,7 @@ function WpaSupplicant:authenticateNetwork(network)
return false, _("An error occurred while selecting network.")
end
-- if password is empty its an open AP
if network.password and (network.password == nil or string.len(network.password) == 0) then -- Open AP
if network.password and #network.password == 0 then -- Open AP
re = wcli:setNetwork(nw_id, "key_mgmt", "NONE")
if re == "FAIL" then
wcli:removeNetwork(nw_id)

View File

@@ -266,7 +266,7 @@ end
function NetworkItem:saveAndConnectToNetwork(password_input)
local new_passwd = password_input:getInputText()
-- Dont set a empty password if WPA encryption, go through if its an open AP
if (new_passwd == nil or string.len(new_passwd) == 0) and string.find(self.info.flags, "WPA") then
if (new_passwd == nil or #new_passwd == 0) and string.find(self.info.flags, "WPA") then
UIManager:show(InfoMessage:new{
text = _("Password cannot be empty."),
})