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 <skokov.m020709@gmail.com>
This commit is contained in:
Maxim Skokov
2026-06-27 02:46:17 +03:00
committed by Jo-Philipp Wich
parent 08ce6fe643
commit cf114f96b6
@@ -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');