File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
core/src/main/java/de/bluecolored/bluemap/core/map/renderstate Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,17 @@ private synchronized T loadCell(Vector2i pos) {
9292 return BLUE_NBT .read (in .decompress (), type );
9393 } catch (IOException ex ) {
9494 Logger .global .logError ("Failed to load render-state cell " + pos , ex );
95+ } catch (RuntimeException ex ) { // E.g. NoSuchElementException thrown by BlueNBT if there is a format error
96+ Logger .global .logError ("Failed to load render-state cell " + pos , ex );
97+
98+ // try to delete the possibly corrupted file for self-healing
99+ try {
100+ storage .delete (pos .getX (), pos .getY ());
101+ } catch (IOException e ) {
102+ Logger .global .logError ("Failed to delete render-state cell " + pos , e );
103+ }
95104 }
105+
96106 return createNewCell ();
97107 }
98108
You can’t perform that action at this time.
0 commit comments