From cd69c118ad04ca36c2530fec225b28ad338a50e9 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 2 May 2020 23:55:06 +0200 Subject: [PATCH] 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 --- .../htdocs/luci-static/resources/view/nlbw/display.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.30.2