🐛 Don’t save ancient Sone objects
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 20 Nov 2019 18:17:30 +0000 (19:17 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 20 Nov 2019 18:17:30 +0000 (19:17 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java

index d79cd40..a8d753e 100644 (file)
@@ -1370,7 +1370,8 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                synchronized (soneInserters) {
                        for (Entry<Sone, SoneInserter> soneInserter : soneInserters.entrySet()) {
                                soneInserter.getValue().stop();
-                               saveSone(soneInserter.getKey());
+                               Sone latestSone = getLocalSone(soneInserter.getKey().getId());
+                               saveSone(latestSone);
                        }
                }
                synchronized (soneRescuers) {