chunk: silently ignore section requests if chunk is not initialized yet

This commit is contained in:
Bixilon 2022-05-09 11:01:10 +02:00
parent 84534c2d9f
commit 7a9ee5779d
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -172,7 +172,7 @@ class Chunk(
@Synchronized
private fun getOrPut(sectionHeight: Int): ChunkSection? {
val sections = sections ?: throw NullPointerException("Sections not initialized yet!")
val sections = sections ?: return null
val sectionIndex = sectionHeight - lowestSection
if (sectionIndex < 0 || sectionIndex > sections.size) {
return null