fix: Handle null response in nDPId settings view

- Add catch() handler for getInterfaces() API call
- Provide fallback interface list if API returns null
- Bump release to r2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-01-09 10:12:51 +01:00
parent 458dd33ef5
commit 66f4f32655
3 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ndpid PKG_NAME:=luci-app-ndpid
PKG_VERSION:=0.9.1 PKG_VERSION:=0.9.1
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_ARCH:=all PKG_ARCH:=all
PKG_LICENSE:=Apache-2.0 PKG_LICENSE:=Apache-2.0

View File

@ -11,13 +11,13 @@ return view.extend({
load: function() { load: function() {
return Promise.all([ return Promise.all([
uci.load('ndpid'), uci.load('ndpid'),
api.getInterfaces() api.getInterfaces().catch(function() { return {}; })
]); ]);
}, },
render: function(data) { render: function(data) {
var interfaces = data[1] || {}; var interfaces = data[1] || {};
var available = interfaces.available || []; var available = (interfaces && interfaces.available) ? interfaces.available : ['br-lan', 'eth0', 'eth1', 'wlan0'];
var m, s, o; var m, s, o;

View File