Skip to content

Commit c269194

Browse files
committed
null check on hit positions
1 parent 2918f96 commit c269194

File tree

1 file changed

+1
-1
lines changed
  • common/src/main/kotlin/com/lambda/interaction/request/rotating/visibilty

1 file changed

+1
-1
lines changed

common/src/main/kotlin/com/lambda/interaction/request/rotating/visibilty/PointSelection.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ enum class PointSelection(val select: (Collection<VisibilityChecker.CheckedHit>)
3535
?.times(1 / hits.size.toDouble())
3636

3737
optimum?.let {
38-
hits.minByOrNull { it.hit.pos distSq optimum }
38+
hits.minByOrNull { it.hit.pos?.distSq(optimum) ?: 0.0 }
3939
}
4040
})
4141
}

0 commit comments

Comments
 (0)