Skip to content

Commit 63ebaa4

Browse files
committed
fix: review 1
1 parent 23722d6 commit 63ebaa4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/Main/src/Core/TileMesh.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,14 @@ class TileMesh extends THREE.Mesh<TileGeometry, LayeredMaterial> {
125125
if (tile.id == this.id) {
126126
return tile;
127127
} else if (tile.level != 0) {
128-
// @ts-expect-error By invariant, parent is always a TileMesh
129-
return this.parent.findCommonAncestor(tile.parent);
128+
return (this.parent as TileMesh)?.findCommonAncestor(tile.parent as TileMesh);
130129
} else {
131130
return undefined;
132131
}
133132
} else if (tile.level < this.level) {
134-
// @ts-expect-error By invariant, parent is always a TileMesh
135-
return this.parent.findCommonAncestor(tile);
133+
return (this.parent as TileMesh)?.findCommonAncestor(tile as TileMesh);
136134
} else {
137-
// @ts-expect-error By invariant, parent is always a TileMesh
138-
return this.findCommonAncestor(tile.parent);
135+
return this.findCommonAncestor(tile.parent as TileMesh);
139136
}
140137
}
141138

0 commit comments

Comments
 (0)