From cf114f96b632adb1ffa54587f7288b17a4d0d2f2 Mon Sep 17 00:00:00 2001 From: Maxim Skokov Date: Sat, 27 Jun 2026 02:46:17 +0300 Subject: [PATCH] luci-theme-bootstrap: handle null board info in container environments ubus.call('system', 'board') returns null in minimal container runtimes without procd. Subsequent accesses to boardinfo.hostname and boardinfo.rootfs_type crash with 'left-hand side expression is null'. Add null fallback to prevent the crash. Fixes openwrt/luci#8726. Signed-off-by: Maxim Skokov --- .../ucode/template/themes/bootstrap/header.ut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/luci-theme-bootstrap/ucode/template/themes/bootstrap/header.ut b/themes/luci-theme-bootstrap/ucode/template/themes/bootstrap/header.ut index a7bbf29889..734d03fecd 100644 --- a/themes/luci-theme-bootstrap/ucode/template/themes/bootstrap/header.ut +++ b/themes/luci-theme-bootstrap/ucode/template/themes/bootstrap/header.ut @@ -8,7 +8,7 @@ {% import { getuid, getspnam } from 'luci.core'; - const boardinfo = ubus.call('system', 'board'); + const boardinfo = ubus.call('system', 'board') ?? {}; const darkpref = (theme == 'bootstrap-dark' ? 'true' : (theme == 'bootstrap-light' ? 'false' : null)); http.prepare_content('text/html; charset=UTF-8');