Skip to content

Commit

Permalink
Add condition to avoid a crash
Browse files Browse the repository at this point in the history
  • Loading branch information
BinaryBrain committed Aug 18, 2024
1 parent 6d7727f commit 6ff0429
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/lamp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ export function initLamp() {
// We set the default value to the current one to sync clients
if (currentCharacteristics[animationName]) {
for (let i = 0; i < options.length; i++) {
options[i].currentCharacteristicValue =
currentCharacteristics[animationName][i].value;
if (typeof currentCharacteristics[animationName][i]?.value !== "undefined") {
options[i].currentCharacteristicValue =
currentCharacteristics[animationName][i].value;
}
}
} else {
options.forEach((option) => {
Expand Down

0 comments on commit 6ff0429

Please sign in to comment.