Skip to content

Commit a280522

Browse files
committed
Fix missing MeshFilter causing Unity editor window updates to stall (issue #64)
1 parent 9294528 commit a280522

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Editor/SceneLOD.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ static void PersistHLODs(LODVolume lodVolume, string scenePath)
4949
if (hlodRoot)
5050
{
5151
var mf = hlodRoot.GetComponent<MeshFilter>();
52-
var sharedMesh= mf.sharedMesh;
53-
if (string.IsNullOrEmpty(AssetDatabase.GetAssetPath(sharedMesh)))
52+
if (mf)
5453
{
55-
SaveUniqueHLODAsset(sharedMesh, scenePath);
54+
var sharedMesh = mf.sharedMesh;
55+
if (string.IsNullOrEmpty(AssetDatabase.GetAssetPath(sharedMesh)))
56+
SaveUniqueHLODAsset(sharedMesh, scenePath);
5657
}
5758
}
5859

0 commit comments

Comments
 (0)