autocore: ethinfo: fix panic issue
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
parent
f6c4028e51
commit
08b6c139d5
@ -12,13 +12,13 @@ for ifname, stat in pairs(util.ubus("network.device", "status")) do
|
||||
|
||||
status = stat.carrier and "yes" or "no"
|
||||
|
||||
if stat.speed:sub(1, 1) == "-" then
|
||||
if not stat.carrier or not stat.speed or stat.speed:sub(1, 1) == "-" then
|
||||
speed = "-"
|
||||
else
|
||||
speed = stat.speed:sub(1, -2) .. "Mb/s"
|
||||
end
|
||||
|
||||
if not stat.carrier then
|
||||
if speed == '-' then
|
||||
duplex = "-"
|
||||
elseif stat.speed:sub(-1) == "F" then
|
||||
duplex = "Full"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user