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 0f58c16848630faec67b477b671cefc50d6807b6..d5029ec90461b1c2be6719ad48e8ba904be2d514 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() }