fix: Add null checks to ScaleAdjusterPreview (#1116)

* fix: Add null checks to ScaleAdjusterPreview

* chore: check for destroyed objects as well

---------

Co-authored-by: bd_ <bd_@nadena.dev>
This commit is contained in:
Rinna Koharu 2024-09-14 10:54:20 +09:00 committed by GitHub
parent 73755e7664
commit 3eaf8bee6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -328,7 +328,7 @@ namespace nadena.dev.modular_avatar.core.editor
var rootBone = _finalBonesMap.TryGetValue(smr.rootBone, out var newRootBone) ? newRootBone : smr.rootBone;
smr.rootBone = rootBone;
smr.bones = smr.bones.Select(b => _finalBonesMap.GetValueOrDefault(b, b)).ToArray();
smr.bones = smr.bones.Select(b => b == null ? null : _finalBonesMap.GetValueOrDefault(b, b)).ToArray();
}
public void Dispose()
@ -341,4 +341,4 @@ namespace nadena.dev.modular_avatar.core.editor
_boneStates.Dispose();
}
}
}
}