Skip to content

Commit b2e46e5

Browse files
author
ohmura
committed
if WorldAnchorObject dont have parent, null exception occur.
change to check to be anchor.gameobject.transform.parent null
1 parent ba03a46 commit b2e46e5

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)