mirror of
https://github.com/openwrt/luci.git
synced 2026-07-12 20:34:31 +04:00
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:
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');
|
||||
|
||||
Reference in New Issue
Block a user