From d1e35c1a69d652ec720e48b0a94905def0a2ca2f Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Mon, 28 Apr 2014 16:41:31 +0200 Subject: [PATCH] Fixed scan error handling issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The getScanInfo could return a false, which wasn’t handled properly resulting in a error and the box sticking into connecting mode. --- src/network/netconfig.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/network/netconfig.lua b/src/network/netconfig.lua index 1e59720..addf197 100644 --- a/src/network/netconfig.lua +++ b/src/network/netconfig.lua @@ -344,9 +344,13 @@ function M.associateSsid(ssid, passphrase, recreate) -- if not, or if newly created configuration is requested, create a new configuration if cfg == nil or recreate ~= nil then - local scanResult = wifi.getScanInfo(ssid) + local scanResult, msg = wifi.getScanInfo(ssid) if scanResult ~= nil then wifi.createConfigFromScanInfo(scanResult, passphrase) + elseif scanResult == false then + --check for error + M.setStatus(M.CONNECTING_FAILED,msg); + return nil,msg else --check for error local msg = "Wireless network "..ssid.." is not available"