mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 03:51:37 +00:00
ChunkCache: fixed possible undefined offset crash in restartPendingRequest()
This commit is contained in:
@@ -132,7 +132,7 @@ class ChunkCache implements ChunkListener{
|
||||
*/
|
||||
private function restartPendingRequest(int $chunkX, int $chunkZ) : void{
|
||||
$chunkHash = World::chunkHash($chunkX, $chunkZ);
|
||||
$existing = $this->caches[$chunkHash];
|
||||
$existing = $this->caches[$chunkHash] ?? null;
|
||||
if($existing === null or $existing->hasResult()){
|
||||
throw new \InvalidArgumentException("Restart can only be applied to unresolved promises");
|
||||
}
|
||||
|
Reference in New Issue
Block a user