]> git.mxchange.org Git - juser-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 6 Oct 2022 13:04:18 +0000 (15:04 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 6 Oct 2022 13:04:18 +0000 (15:04 +0200)
- use null-safe Contacts.compare()

src/org/mxchange/jusercore/model/user/LoginUser.java

index 7c673ac5ef1363de1d77d9aeeeff997cc28893da..bb757345f86c941250c9147fe61a89f634d20229 100644 (file)
@@ -38,6 +38,7 @@ import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import javax.persistence.Transient;
 import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jcontacts.model.contact.Contacts;
 import org.mxchange.jcontacts.model.contact.UserContact;
 import org.mxchange.jcoreutils.Comparables;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
@@ -229,7 +230,7 @@ public class LoginUser implements User {
                // Init comparitors
                final int comparitors[] = {
                        // First contact
-                       this.getUserContact().compareTo(user.getUserContact()),
+                       Contacts.compare(this.getUserContact(), user.getUserContact()),
                        // ... then user name
                        this.getUserName().compareTo(user.getUserName())
                };