From 68ee26ce6f880cafc85a074d7b6d821d4dc6d60f Mon Sep 17 00:00:00 2001 From: Jamie Cope Date: Thu, 8 Feb 2024 15:44:05 -0500 Subject: [PATCH] Skip null properties when tweening --- source/components/CTweenMachine.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/components/CTweenMachine.ts b/source/components/CTweenMachine.ts index 2551954..bb58478 100644 --- a/source/components/CTweenMachine.ts +++ b/source/components/CTweenMachine.ts @@ -403,7 +403,7 @@ export default class CTweenMachine extends Component const target = targets[i]; const property = target.property; - if (target.isNumber && valuesB) { + if (target.isNumber && valuesB && valuesB[i]) { const vA = valuesA[i]; const vB = valuesB[i]; if (target.isArray) { @@ -424,7 +424,7 @@ export default class CTweenMachine extends Component } } else if (!valuesB || doSwitch) { - const value = valuesB ? valuesB[i] : valuesA[i]; + const value = valuesB && valuesB[i] ? valuesB[i] : valuesA[i]; if (target.isArray) { let changed = false;