X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FAlbumImpl.java;h=bb32d752fc1f1e801e7f6bf9b6ae1d32f764047a;hb=43740d6a1dfc686ab54d0aebd4a5b1bce75b9ed6;hp=b60e99e1032d0905b6fcd66c01e1eb590751f2a0;hpb=ec06ae64c86f0b06bb0cf9f8b289e7907e81dffa;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/data/AlbumImpl.java b/src/main/java/net/pterodactylus/sone/data/AlbumImpl.java index b60e99e..bb32d75 100644 --- a/src/main/java/net/pterodactylus/sone/data/AlbumImpl.java +++ b/src/main/java/net/pterodactylus/sone/data/AlbumImpl.java @@ -303,6 +303,9 @@ public class AlbumImpl implements Album { @Override public Album update() throws IllegalStateException { + if (title.isPresent() && title.get().trim().isEmpty()) { + throw new AlbumTitleMustNotBeEmpty(); + } if (title.isPresent()) { AlbumImpl.this.title = title.get(); } @@ -317,6 +320,8 @@ public class AlbumImpl implements Album { }; } + public static class AlbumTitleMustNotBeEmpty extends IllegalStateException { } + // // FINGERPRINTABLE METHODS //