Fix null reference exception when bone frame is not found

This commit is contained in:
Sinematic3D
2026-01-20 02:21:27 +01:00
parent 6b66ec7467
commit 7f0d606ccc
+7 -8
View File
@@ -228,19 +228,18 @@ namespace AssetStudio.FbxInterop
foreach (var bone in boneList)
{
var cluster = IntPtr.Zero;
if (bone.Path != null)
{
var frame = rootFrame.FindFrameByPath(bone.Path);
var boneNode = _frameToNode[frame];
var cluster = AsFbxMeshCreateCluster(_pContext, boneNode);
AsFbxMeshAddCluster(pClusterArray, cluster);
}
else
{
AsFbxMeshAddCluster(pClusterArray, IntPtr.Zero);
if (frame != null)
{
var boneNode = _frameToNode[frame];
cluster = AsFbxMeshCreateCluster(_pContext, boneNode);
}
}
AsFbxMeshAddCluster(pClusterArray, cluster);
}
}