The PathFollower.pathUpdate method will now check if the tween property has a valid data component before running the update. This prevents a call to PathFollower.stopFollow from throwing a Cannot read properties of null (reading '0') error as it tried to do a single update post stop. Fix #6508

This commit is contained in:
Richard Davey 2023-07-21 18:20:38 +01:00
parent 4d99863188
commit c44dbccedc

View file

@ -359,7 +359,7 @@ var PathFollower = {
{
var tween = this.pathTween;
if (tween)
if (tween && tween.data)
{
var tweenData = tween.data[0];
var pathDelta = this.pathDelta;