X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FProfile.java;h=03e9a914c858dfc85b917fe83ab0c7ecf33685fb;hb=47f4a6392781b4e48ee99bde32dcede99309f864;hp=6201276b8a03c3dafade2630fb7971b76e546039;hpb=532076508aac8e03e0ef9914e90c7a0558b66bbe;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/data/Profile.java b/src/main/java/net/pterodactylus/sone/data/Profile.java index 6201276..03e9a91 100644 --- a/src/main/java/net/pterodactylus/sone/data/Profile.java +++ b/src/main/java/net/pterodactylus/sone/data/Profile.java @@ -217,7 +217,7 @@ public class Profile implements Fingerprintable { public Field addField(String fieldName) throws IllegalArgumentException { checkNotNull(fieldName, "fieldName must not be null"); checkArgument(fieldName.length() > 0, "fieldName must not be empty"); - checkState(getFieldByName(fieldName) == null, "fieldName must be unique"); + checkState(!getFieldByName(fieldName).isPresent(), "fieldName must be unique"); @SuppressWarnings("synthetic-access") Field field = new Field(fieldName); fields.add(field);