From: Jo-Philipp Wich Date: Sat, 2 May 2020 21:55:06 +0000 (+0200) Subject: luci-app-nlbwmon: gracefully handle failing oui db download X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=cd69c118ad04ca36c2530fec225b28ad338a50e9;p=project%2Fluci.git luci-app-nlbwmon: gracefully handle failing oui db download Fixes: #3980 Fixes: fdce990b9 ("luci-app-nlbwmon: convert to client side JS") Signed-off-by: Jo-Philipp Wich --- diff --git a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js index 1bf6687822..1b654d7bca 100644 --- a/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js +++ b/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js @@ -50,8 +50,8 @@ return view.extend({ loadOUI: function() { var url = 'https://raw.githubusercontent.com/jow-/oui-database/master/oui.json'; - return L.resolveDefault(request.get(url, { cache: true }), []).then(function(res) { - res = res.json(); + return L.resolveDefault(request.get(url, { cache: true })).then(function(res) { + res = res ? res.json() : []; if (Array.isArray(res)) ouiData = res;