X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FProfile.java;h=34246cb1bf8dd31189430749e2688659621324c0;hp=76e0acf1c56263f20402c20eff8aed6b7df206e5;hb=64740709990291688170ebd1f192af5eb9090618;hpb=b9fc06f5bf20b1c0d5e7c5e9b49e87581a843ee7 diff --git a/src/main/java/net/pterodactylus/sone/data/Profile.java b/src/main/java/net/pterodactylus/sone/data/Profile.java index 76e0acf..34246cb 100644 --- a/src/main/java/net/pterodactylus/sone/data/Profile.java +++ b/src/main/java/net/pterodactylus/sone/data/Profile.java @@ -1,5 +1,5 @@ /* - * Sone - Profile.java - Copyright © 2010–2019 David Roden + * Sone - Profile.java - Copyright © 2010–2020 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,6 @@ package net.pterodactylus.sone.data; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.base.Preconditions.checkState; import static java.nio.charset.StandardCharsets.UTF_8; import java.util.ArrayList; @@ -127,7 +126,7 @@ public class Profile implements Fingerprintable { */ @Nonnull public Profile setFirstName(@Nullable String firstName) { - this.firstName = firstName; + this.firstName = "".equals(firstName) ? null : firstName; return this; } @@ -150,7 +149,7 @@ public class Profile implements Fingerprintable { */ @Nonnull public Profile setMiddleName(@Nullable String middleName) { - this.middleName = middleName; + this.middleName = "".equals(middleName) ? null : middleName; return this; } @@ -173,7 +172,7 @@ public class Profile implements Fingerprintable { */ @Nonnull public Profile setLastName(@Nullable String lastName) { - this.lastName = lastName; + this.lastName = "".equals(lastName) ? null : lastName; return this; }