Skip to content

Commit e9142e5

Browse files
committed
Fix Waypoint crash
1 parent 77d66d9 commit e9142e5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/kotlin/com/lambda/client/manager/managers/WaypointManager.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ object WaypointManager : Manager {
9797
}
9898

9999
fun remove(pos: BlockPos, currentDimension: Boolean = false): Boolean {
100-
val waypoint = get(pos, currentDimension)
101-
val removed = waypoints.remove(waypoint)
102-
LambdaEventBus.post(WaypointUpdateEvent(WaypointUpdateEvent.Type.REMOVE, waypoint))
103-
return removed
100+
return get(pos, currentDimension)?.let { waypoint ->
101+
LambdaEventBus.post(WaypointUpdateEvent(WaypointUpdateEvent.Type.REMOVE, waypoint))
102+
waypoints.remove(waypoint)
103+
} ?: false
104104
}
105105

106106
fun remove(id: Int): Boolean {

0 commit comments

Comments
 (0)