fix: issues preventing error log from being displayed in some cases (#409)

This commit is contained in:
bd_ 2023-08-28 21:25:17 +09:00 committed by GitHub
parent 61de99e01f
commit 8da1c9d3be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,13 +112,8 @@ namespace nadena.dev.modular_avatar.editor.ErrorReporting
{
activeAvatarObject = RuntimeUtil.FindAvatarInParents(Selection.activeGameObject.transform)?.gameObject;
activeAvatar = BuildReport.CurrentReport.Avatars.FirstOrDefault(av =>
av.objectRef.path == RuntimeUtil.RelativePath(null, activeAvatarObject));
if (activeAvatar == null)
{
activeAvatar = new AvatarReport();
activeAvatar.objectRef = new ObjectRef(activeAvatarObject);
}
av.objectRef.path == RuntimeUtil.RelativePath(null, activeAvatarObject)
|| av.objectRef.path == RuntimeUtil.RelativePath(null, activeAvatarObject) + "(Clone)");
}
if (activeAvatar == null)
@ -126,6 +121,12 @@ namespace nadena.dev.modular_avatar.editor.ErrorReporting
activeAvatar = BuildReport.CurrentReport.Avatars.LastOrDefault();
}
if (activeAvatar == null)
{
activeAvatar = new AvatarReport();
activeAvatar.objectRef = new ObjectRef(activeAvatarObject);
}
if (activeAvatar != null)
{
reported++;