- [Core] handle HasMesh exception.

This commit is contained in:
Razmoth
2024-02-06 22:03:55 +04:00
parent 3d5a1bcdf2
commit 14a6115d70

View File

@@ -39,6 +39,8 @@ namespace AssetStudio
public bool HasModel() => HasMesh(m_Transform, new List<bool>()); public bool HasModel() => HasMesh(m_Transform, new List<bool>());
private static bool HasMesh(Transform m_Transform, List<bool> meshes) private static bool HasMesh(Transform m_Transform, List<bool> meshes)
{
try
{ {
m_Transform.m_GameObject.TryGet(out var m_GameObject); m_Transform.m_GameObject.TryGet(out var m_GameObject);
@@ -62,6 +64,12 @@ namespace AssetStudio
return meshes.Any(x => x == true); return meshes.Any(x => x == true);
} }
catch(Exception e)
{
Logger.Warning($"Unable to verify if {m_Transform?.Name} has meshes, skipping...");
return false;
}
}
private static Mesh GetMesh(Renderer meshR) private static Mesh GetMesh(Renderer meshR)
{ {