diff --git a/src/lib/rhinoBridge.js b/src/lib/rhinoBridge.js index a4068c2..88f225a 100644 --- a/src/lib/rhinoBridge.js +++ b/src/lib/rhinoBridge.js @@ -278,19 +278,23 @@ export function saveCurrentAsCombination(name) { send('SAVE_CURRENT_AS_PRESET' export function deleteCombinationPreset(name) { send('DELETE_PRESET', { name }) } export function applyVisibility(activeZ, zeichnungsebenen, activeCode, ebenen, zMode, eMode) { + // Split-Panels koennen mit null/[] fuer fremde Slice aufrufen — Backend + // fuellt aus doc.Strings. Hier robust gegen alles Falsy. _visArgs = { activeZ, zeichnungsebenen, activeCode, ebenen, zMode, eMode } if (_visTimer) clearTimeout(_visTimer) _visTimer = setTimeout(() => { _visTimer = null const a = _visArgs - const slimZ = a.zeichnungsebenen.map(z => ({ + const zList = Array.isArray(a.zeichnungsebenen) ? a.zeichnungsebenen : [] + const eList = Array.isArray(a.ebenen) ? a.ebenen : [] + const slimZ = zList.map(z => ({ id: z.id, name: z.name, visible: z.visible !== false, })) - const slimE = a.ebenen.map(e => ({ + const slimE = eList.map(e => ({ code: e.code, visible: e.visible !== false, locked: e.locked === true, })) send('SET_VISIBILITY', { - activeZ: { id: a.activeZ.id }, + activeZ: a.activeZ ? { id: a.activeZ.id } : null, activeCode: a.activeCode, zeichnungsebenen: slimZ, ebenen: slimE,