From 802c3cd0282276e12941e04d1f11cb82c343cc8b Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Tue, 16 Dec 2025 10:54:39 -0600 Subject: [PATCH] Fix sanitizeShapes. --- inventory/templates/testing.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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') {