mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-09 21:29:08 +01:00
Log the proper warning message instead of a NPE
This commit is contained in:
parent
b296b103c1
commit
097dcf0f6c
@ -6,6 +6,7 @@ import net.minestom.server.utils.callback.OptionalCallback;
|
||||
import net.minestom.server.utils.chunk.ChunkCallback;
|
||||
import net.minestom.server.utils.chunk.ChunkSupplier;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -37,10 +38,10 @@ public class MinestomBasicChunkLoader implements IChunkLoader {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveChunk(@NotNull Chunk chunk, Runnable callback) {
|
||||
public void saveChunk(@NotNull Chunk chunk, @Nullable Runnable callback) {
|
||||
final StorageLocation storageLocation = instanceContainer.getStorageLocation();
|
||||
if (storageLocation == null) {
|
||||
callback.run();
|
||||
OptionalCallback.execute(callback);
|
||||
LOGGER.warn("No storage location to save chunk!");
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user