- Album parentAlbum = album.getParent();
- webInterface.getCore().deleteAlbum(album);
- if (parentAlbum == null) {
- throw new RedirectException("imageBrowser.html?sone=" + album.getSone().getId());
+ Album parentAlbum = album.get().getParent();
+ album.get().remove();
+ if (parentAlbum.equals(album.get().getSone().getRootAlbum())) {
+ throw new RedirectException("imageBrowser.html?sone=" + album.get().getSone().getId());