fix: null reference errors when apply on play triggers late (#490)

When an avatar is enabled after the scene is initially loaded, Merge Armature
would result in a lot of NullReferenceExceptions being logged.
This commit is contained in:
bd_ 2023-10-09 18:59:50 +09:00 committed by GitHub
parent 68bc7ece54
commit 491cb97fb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,6 +131,8 @@ namespace nadena.dev.modular_avatar.core
private List<(Transform, Transform)> GetBonesForLock()
{
if (this == null) return null;
var mergeRoot = this.transform;
var baseRoot = mergeTarget.Get(this);