diff --git a/inventory/templates/testing.html b/inventory/templates/testing.html index 2b22eda..b4c9076 100644 --- a/inventory/templates/testing.html +++ b/inventory/templates/testing.html @@ -240,9 +240,12 @@ scheduleSnappedGridSize(); function isFiniteNum(n) { return Number.isFinite(Number(n)); } function sanitizeShapes(list) { + const allowed = ['rect', 'ellipse', 'line']; + return list.filter(s => { if (!s || typeof s !== 'object') return false; - if (!['rect','ellipse','line'].include(s.type)) return false; + if (!allowed.includes(s.type)) return false; + if (!s.color) s.color = '#000000'; if (s.type === 'line') {