mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-22 10:35:16 +01:00
Fix self-healing for corrupted render-state files, fixes: #588
This commit is contained in:
parent
f25ebfead3
commit
48fa5b6abc
@ -92,7 +92,17 @@ private synchronized T loadCell(Vector2i pos) {
|
|||||||
return BLUE_NBT.read(in.decompress(), type);
|
return BLUE_NBT.read(in.decompress(), type);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.global.logError("Failed to load render-state cell " + pos, ex);
|
Logger.global.logError("Failed to load render-state cell " + pos, ex);
|
||||||
|
} catch (RuntimeException ex) { // E.g. NoSuchElementException thrown by BlueNBT if there is a format error
|
||||||
|
Logger.global.logError("Failed to load render-state cell " + pos, ex);
|
||||||
|
|
||||||
|
// try to delete the possibly corrupted file for self-healing
|
||||||
|
try {
|
||||||
|
storage.delete(pos.getX(), pos.getY());
|
||||||
|
} catch (IOException e) {
|
||||||
|
Logger.global.logError("Failed to delete render-state cell " + pos, e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return createNewCell();
|
return createNewCell();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user