Move timestamp logic into a safe place

This commit is contained in:
BrainStone 2021-07-23 00:35:40 +02:00
parent e3d5990dbe
commit 2a7e69e281
No known key found for this signature in database
GPG Key ID: 66CCC234C2CEB306

View File

@ -155,11 +155,12 @@ public abstract class DynmapWorld {
} }
try { try {
MapStorageTile.TileRead tr = tile1.read(); MapStorageTile.TileRead tr = tile1.read();
mostRecentTimestamp = Math.max(mostRecentTimestamp, tr.lastModified);
if (tr != null) { if (tr != null) {
BufferedImage im = null; BufferedImage im = null;
try { try {
im = ImageIOManager.imageIODecode(tr); im = ImageIOManager.imageIODecode(tr);
// Only consider the timestamp when the tile exists and isn't broken
mostRecentTimestamp = Math.max(mostRecentTimestamp, tr.lastModified);
} catch (IOException iox) { } catch (IOException iox) {
// Broken file - zap it // Broken file - zap it
tile1.delete(); tile1.delete();