소스 검색

Fix util.lua (hidden networks in range)

If there is a hidden network in range it will have a 'nil' SSID value and the match function will result in an error aborting the updater.
This commit also checks for the bssid value so that if the bssid gathering whyever fails it doesn't let the whole updater fail.
Vincent Wiemann 7 년 전
부모
커밋
f2d9cebf2a
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      ffho/ffho-autoupdater-wifi-fallback/luasrc/usr/lib/lua/autoupdater-wifi-fallback/util.lua

+ 4 - 2
ffho/ffho-autoupdater-wifi-fallback/luasrc/usr/lib/lua/autoupdater-wifi-fallback/util.lua

@@ -16,8 +16,10 @@ function get_available_wifi_networks()
     if iw then
       local list = iw.scanlist(radio)
       for _, net in ipairs(list) do
-        if net.ssid:match('.*[Ff][Rr][Ee][Ii][Ff][Uu][Nn][Kk].*') then
-          return radio, net.ssid, net.bssid
+        if net.ssid and net.bssid then
+          if net.ssid:match('.*[Ff][Rr][Ee][Ii][Ff][Uu][Nn][Kk].*') then
+            return radio, net.ssid, net.bssid
+          end
         end
       end
     end