Insert a root album into all Sones to get rid of album manipulation in the Sone.
[Sone.git] / src / main / java / net / pterodactylus / sone / template / AlbumAccessor.java
index 96891e5..fcd7a70 100644 (file)
@@ -45,7 +45,7 @@ public class AlbumAccessor extends ReflectionAccessor {
                if ("backlinks".equals(member)) {
                        List<Map<String, String>> backlinks = new ArrayList<Map<String, String>>();
                        Album currentAlbum = album;
-                       while (currentAlbum != null) {
+                       while (!currentAlbum.equals(album.getSone().getRootAlbum())) {
                                backlinks.add(0, createLink("imageBrowser.html?album=" + currentAlbum.getId(), currentAlbum.getTitle()));
                                currentAlbum = currentAlbum.getParent();
                        }