luci-base: handle potential crash in luci.model.network.interface.get_i18n()
authorJo-Philipp Wich <jo@mein.io>
Sat, 19 May 2018 20:11:05 +0000 (22:11 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 19 May 2018 20:11:08 +0000 (22:11 +0200)
Should prevent the crash mentioned in #1779.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/luasrc/model/network.lua

index 0f58c16..d5029ec 100644 (file)
@@ -1273,7 +1273,7 @@ function interface.get_i18n(self)
                return "%s: %s %q" %{
                        lng.translate("Wireless Network"),
                        self.wif:active_mode(),
-                       self.wif:active_ssid() or self.wif:active_bssid() or self.wif:id()
+                       self.wif:active_ssid() or self.wif:active_bssid() or self.wif:id() or "?"
                }
        else
                return "%s: %q" %{ self:get_type_i18n(), self:name() }