diff options
author | Florian Eckert <fe@dev.tdt.de> | 2019-09-23 09:04:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-23 09:04:17 +0200 |
commit | cf239f9e1086efea592d5413e3c7f16a3ff06703 (patch) | |
tree | f0876b3a749c33992824af2fd944815d29f8c58b /applications | |
parent | 277053a5e999bad4edbcdc5c491826b2d01ed307 (diff) | |
parent | 7863ff72724bbb84831d595ef60405072713c379 (diff) |
Merge pull request #1735 from sumpfralle/olsr-jsoninfo-parser-handle-empty-result
luci-app-olsr: handle empty result for non-status tables
Diffstat (limited to 'applications')
-rw-r--r-- | applications/luci-app-olsr/luasrc/controller/olsr.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/applications/luci-app-olsr/luasrc/controller/olsr.lua b/applications/luci-app-olsr/luasrc/controller/olsr.lua index 11e27d7c0..75463d405 100644 --- a/applications/luci-app-olsr/luasrc/controller/olsr.lua +++ b/applications/luci-app-olsr/luasrc/controller/olsr.lua @@ -379,9 +379,9 @@ function fetch_jsoninfo(otable) if jsonreq4 ~= "" then has_v4 = 1 - jsondata4 = json.decode(jsonreq4) + jsondata4 = json.decode(jsonreq4) or {} if otable == 'status' then - data4 = jsondata4 or {} + data4 = jsondata4 else data4 = jsondata4[otable] or {} end @@ -393,9 +393,9 @@ function fetch_jsoninfo(otable) end if jsonreq6 ~= "" then has_v6 = 1 - jsondata6 = json.decode(jsonreq6) + jsondata6 = json.decode(jsonreq6) or {} if otable == 'status' then - data6 = jsondata6 or {} + data6 = jsondata6 else data6 = jsondata6[otable] or {} end |