Let core be an album provider
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ImageBrowserPage.java
index 60b22d5..36805b3 100644 (file)
@@ -69,9 +69,9 @@ public class ImageBrowserPage extends SoneTemplatePage {
                super.processTemplate(request, templateContext);
                String albumId = request.getHttpRequest().getParam("album", null);
                if (albumId != null) {
-                       Album album = webInterface.getCore().getAlbum(albumId);
+                       Optional<Album> album = webInterface.getCore().getAlbum(albumId);
                        templateContext.set("albumRequested", true);
-                       templateContext.set("album", album);
+                       templateContext.set("album", album.orNull());
                        templateContext.set("page", request.getHttpRequest().getParam("page"));
                        return;
                }