From 1c38d618971b031925bc6d796acce31c22e49ede Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Mon, 19 Oct 2020 16:18:36 +0200 Subject: [PATCH] Fix MPTCP bandwidth when no data --- luci-app-mptcp/luasrc/controller/mptcp.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/luci-app-mptcp/luasrc/controller/mptcp.lua b/luci-app-mptcp/luasrc/controller/mptcp.lua index fb69ac06b..1a593b844 100644 --- a/luci-app-mptcp/luasrc/controller/mptcp.lua +++ b/luci-app-mptcp/luasrc/controller/mptcp.lua @@ -114,9 +114,15 @@ function multipath_bandwidth() res["total"][i][j]= tonumber(res["total"][i][j]) end if j ==1 then - res["total"][i][j] = res[key][i][j] + if res[key][i][j] ~= nil then + res["total"][i][j] = res[key][i][j] + else + res["total"][i][j] = 0 + end else - res["total"][i][j] = res["total"][i][j] + res[key][i][j] + if res[key][i][j] ~= nil then + res["total"][i][j] = res["total"][i][j] + res[key][i][j] + end end end end