From 66f4f326553e4075836e9d01144914cfd96057d0 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Fri, 9 Jan 2026 10:12:51 +0100 Subject: [PATCH] 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 --- package/secubox/luci-app-ndpid/Makefile | 2 +- .../htdocs/luci-static/resources/view/ndpid/settings.js | 4 ++-- .../secubox/luci-app-ndpid/root/usr/libexec/rpcd/luci.ndpid | 0 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 package/secubox/luci-app-ndpid/root/usr/libexec/rpcd/luci.ndpid diff --git a/package/secubox/luci-app-ndpid/Makefile b/package/secubox/luci-app-ndpid/Makefile index f5bd4a6c..821a5a15 100644 --- a/package/secubox/luci-app-ndpid/Makefile +++ b/package/secubox/luci-app-ndpid/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ndpid PKG_VERSION:=0.9.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_ARCH:=all PKG_LICENSE:=Apache-2.0 diff --git a/package/secubox/luci-app-ndpid/htdocs/luci-static/resources/view/ndpid/settings.js b/package/secubox/luci-app-ndpid/htdocs/luci-static/resources/view/ndpid/settings.js index 205e0f42..7cec383c 100644 --- a/package/secubox/luci-app-ndpid/htdocs/luci-static/resources/view/ndpid/settings.js +++ b/package/secubox/luci-app-ndpid/htdocs/luci-static/resources/view/ndpid/settings.js @@ -11,13 +11,13 @@ return view.extend({ load: function() { return Promise.all([ uci.load('ndpid'), - api.getInterfaces() + api.getInterfaces().catch(function() { return {}; }) ]); }, render: function(data) { var interfaces = data[1] || {}; - var available = interfaces.available || []; + var available = (interfaces && interfaces.available) ? interfaces.available : ['br-lan', 'eth0', 'eth1', 'wlan0']; var m, s, o; diff --git a/package/secubox/luci-app-ndpid/root/usr/libexec/rpcd/luci.ndpid b/package/secubox/luci-app-ndpid/root/usr/libexec/rpcd/luci.ndpid old mode 100644 new mode 100755