fix: Handle undefined options in WidgetRenderer constructor

Fix TypeError when WidgetRenderer is instantiated with undefined options
parameter by adding defensive check at start of __init__ method.

Error:
  TypeError: can't access property "containerId", options is undefined

Fix:
  options = options || {};

This ensures the constructor works even if called without parameters,
preventing the TypeError when accessing options.containerId.

Incremented PKG_RELEASE: 3 → 4
This commit is contained in:
CyberMind-FR 2026-01-04 14:41:53 +01:00
parent 8f38796b75
commit b0c944c244
2 changed files with 4 additions and 1 deletions

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-secubox-admin
PKG_VERSION:=1.0.0
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_LICENSE:=MIT
PKG_MAINTAINER:=CyberMind <contact@cybermind.fr>

View File

@ -20,6 +20,9 @@ var WidgetRenderer = baseclass.extend({
* @param {string} options.gridMode - Grid layout mode: 'auto', 'fixed-2', 'fixed-3', 'fixed-4' (default: 'auto')
*/
__init__: function(options) {
// Ensure options is an object
options = options || {};
this.containerId = options.containerId || 'widget-container';
this.apps = options.apps || [];
this.defaultRefreshInterval = options.defaultRefreshInterval || 30;