diff --git a/AssetStudioFBXWrapper/FbxExporterContext.cs b/AssetStudioFBXWrapper/FbxExporterContext.cs index 8040d0c6c..d8fa9a47e 100644 --- a/AssetStudioFBXWrapper/FbxExporterContext.cs +++ b/AssetStudioFBXWrapper/FbxExporterContext.cs @@ -228,19 +228,18 @@ private void ExportMesh(ImportedFrame rootFrame, List material 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); } }