luci-app-nlbwmon: gracefully handle failing oui db download
authorJo-Philipp Wich <jo@mein.io>
Sat, 2 May 2020 21:55:06 +0000 (23:55 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 2 May 2020 21:55:06 +0000 (23:55 +0200)
Fixes: #3980
Fixes: fdce990b9 ("luci-app-nlbwmon: convert to client side JS")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/display.js

index 1bf6687822c59b5105f0ebd144317527b33c3345..1b654d7bcae66327955de962095fc43daf2dfb89 100644 (file)
@@ -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;