🔀 Merge “release/v81” into “master”
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Profile.java
index 76e0acf..b87ef4f 100644 (file)
@@ -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
@@ -127,7 +127,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 +150,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 +173,7 @@ public class Profile implements Fingerprintable {
         */
        @Nonnull
        public Profile setLastName(@Nullable String lastName) {
-               this.lastName = lastName;
+               this.lastName = "".equals(lastName) ? null : lastName;
                return this;
        }