Skip to content

Commit f42dce7

Browse files
authored
Merge pull request #2932 from kyos1704/Fix_WorldAnchorManager
fix bug : Null Exception occur in WorldAnchorManager
2 parents ba03a46 + b2e46e5 commit f42dce7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Assets/HoloToolkit/Common/Scripts/WorldAnchorManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public void RemoveAllAnchors()
324324
for (var i = 0; i < anchors.Length; i++)
325325
{
326326
// Don't remove SpatialMapping anchors if exists
327-
if (spatialMappingManager != null && anchors[i].gameObject.transform.parent.gameObject == spatialMappingManager.gameObject)
327+
if (spatialMappingManager != null && anchors[i].gameObject.transform.parent != null && anchors[i].gameObject.transform.parent.gameObject == spatialMappingManager.gameObject)
328328
{ continue; }
329329

330330
// Let's check to see if there are anchors we weren't accounting for.

0 commit comments

Comments
 (0)