Null check onComplete parameter for scheduleChunkLoad with gen = false
When gen = true, the parameter may be null. There is no reason it should NPE then when gen = false.
This commit is contained in:
@@ -457,12 +457,16 @@ public final class ChunkTaskScheduler {
|
||||
}
|
||||
this.scheduleChunkLoad(chunkX, chunkZ, ChunkStatus.EMPTY, addTicket, priority, (final ChunkAccess chunk) -> {
|
||||
if (chunk == null) {
|
||||
onComplete.accept(null);
|
||||
if (onComplete != null) {
|
||||
onComplete.accept(null);
|
||||
}
|
||||
} else {
|
||||
if (chunk.getPersistedStatus().isOrAfter(toStatus)) {
|
||||
this.scheduleChunkLoad(chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
|
||||
} else {
|
||||
onComplete.accept(null);
|
||||
if (onComplete != null) {
|
||||
onComplete.accept(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user