diff --git a/dashboard/js/ambient_renderer.js b/dashboard/js/ambient_renderer.js index a25aec2..5a84b89 100644 --- a/dashboard/js/ambient_renderer.js +++ b/dashboard/js/ambient_renderer.js @@ -766,6 +766,11 @@ } function getPersonColor(personName) { + // Identity name fields (personName/person_label) are optional on the wire; + // never dereference an undefined name. Today's sole caller guards with + // `if (personName)`, but harden the helper so the contract holds for any + // future caller (audit bf-gcotl / parent bf-2gmx). + if (!personName) return '#6b7280'; // Grey for unknown (matches line ~629) // Generate consistent color from name let hash = 0; for (let i = 0; i < personName.length; i++) { diff --git a/dashboard/js/ble-panel.js b/dashboard/js/ble-panel.js index 548002e..ff01ea1 100644 --- a/dashboard/js/ble-panel.js +++ b/dashboard/js/ble-panel.js @@ -825,6 +825,11 @@ } function getColorForPerson(personName) { + // Identity name fields (person_name/personName) are optional on the wire; + // never dereference an undefined name. Currently has no callers, but + // harden the helper so it is safe for any future caller + // (audit bf-gcotl / parent bf-2gmx). + if (!personName) return '#888888'; // device default color (matches line ~181) // Check if we have a person with this name in our people list var person = state.people.find(function(p) { return p.name === personName; }); if (person && person.color) {