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) foreach (var bone in boneList)
{ {
var cluster = IntPtr.Zero;
if (bone.Path != null) if (bone.Path != null)
{ {
var frame = rootFrame.FindFrameByPath(bone.Path); var frame = rootFrame.FindFrameByPath(bone.Path);
var boneNode = _frameToNode[frame];
var cluster = AsFbxMeshCreateCluster(_pContext, boneNode); if (frame != null)
{
AsFbxMeshAddCluster(pClusterArray, cluster); var boneNode = _frameToNode[frame];
} cluster = AsFbxMeshCreateCluster(_pContext, boneNode);
else }
{
AsFbxMeshAddCluster(pClusterArray, IntPtr.Zero);
} }
AsFbxMeshAddCluster(pClusterArray, cluster);
} }
} }