Merge pull request #532 from ousttrue/fix/fix_export_root_null

NullReferenceException
This commit is contained in:
hiroj 2020-08-31 14:09:04 +09:00 committed by GitHub
commit 049ed5240e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -705,12 +705,17 @@ namespace VRM
m_validations.Clear();
m_validations.AddRange(Validate());
m_validations.AddRange(VRMSpringBoneValidator.Validate(ExportRoot));
var firstPerson = ExportRoot.GetComponent<VRMFirstPerson>();
if (firstPerson != null)
if (ExportRoot != null)
{
m_validations.AddRange(firstPerson.Validate());
m_validations.AddRange(VRMSpringBoneValidator.Validate(ExportRoot));
var firstPerson = ExportRoot.GetComponent<VRMFirstPerson>();
if (firstPerson != null)
{
m_validations.AddRange(firstPerson.Validate());
}
}
var hasError = m_validations.Any(x => !x.CanExport);
m_IsValid = !hasError && !MetaHasError;