From cffdbb6f2f7aea9bd5496e171aeed5d727953a0f Mon Sep 17 00:00:00 2001 From: Ralph Mack Date: Mon, 2 Sep 2024 14:48:31 -0400 Subject: [PATCH] Found one more glitch in fallbacks --- src/library.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/library.mjs b/src/library.mjs index a99b9c4..451c560 100644 --- a/src/library.mjs +++ b/src/library.mjs @@ -136,12 +136,14 @@ export default class SourceLibrary { if (sources[source].consumable === "false") { sources[source].consumable = false; } + // Normalize lights to be an array, not a single object if ( sources[source].light && - sources[source].light.constructor !== Array + sources[source].light.constructor.name !== "Array" ) { sources[source].light = [sources[source].light]; } + // If states isn't specified, derive it by counting the lights and adding one for "off" state. if ( sources[source].light && sources[source].light.constructor.name === "Array" &&