Delete temporary image before removing image.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 13 Apr 2011 04:35:28 +0000 (06:35 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 13 Apr 2011 04:41:30 +0000 (06:41 +0200)
src/main/java/net/pterodactylus/sone/core/Core.java

index 91a04d3..f5d695c 100644 (file)
@@ -1901,11 +1901,11 @@ public class Core implements IdentityListener, UpdateListener, ImageInsertListen
         */
        public void deleteImage(Image image) {
                Validation.begin().isNotNull("Image", image).check().is("Local Sone", isLocalSone(image.getSone())).check();
+               deleteTemporaryImage(image.getId());
                image.getAlbum().removeImage(image);
                synchronized (images) {
                        images.remove(image.getId());
                }
-               deleteTemporaryImage(image.getId());
                saveSone(image.getSone());
        }