aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-08-01 13:41:26 +0200
committerChristian Schneppe <christian@pix-art.de>2017-08-01 13:41:26 +0200
commita76bc74a970b051c3ac247ebd3d20fc5a98c8542 (patch)
tree75474a49a7d44def1d078373c5ca7f37d8b93d5d /src/main/java/de/pixart
parent62bddc494de8da7de7f59e789b415d666a210666 (diff)
avoid empty strings when figuring out display name
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Contact.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Contact.java b/src/main/java/de/pixart/messenger/entities/Contact.java
index 8079ff2db..9681e69bc 100644
--- a/src/main/java/de/pixart/messenger/entities/Contact.java
+++ b/src/main/java/de/pixart/messenger/entities/Contact.java
@@ -112,13 +112,13 @@ public class Contact implements ListItem, Blockable {
}
public String getDisplayName() {
- if (this.commonName != null && Config.X509_VERIFICATION) {
+ if (Config.X509_VERIFICATION && this.commonName != null && !this.commonName.isEmpty()) {
return this.commonName;
- } else if (this.systemName != null) {
+ } else if (this.systemName != null && !this.systemName.isEmpty()) {
return this.systemName;
- } else if (this.serverName != null) {
+ } else if (this.serverName != null && !this.serverName.isEmpty()) {
return this.serverName;
- } else if (this.presenceName != null && mutualPresenceSubscription()) {
+ } else if (this.presenceName != null && !this.presenceName.isEmpty() && mutualPresenceSubscription()) {
return this.presenceName;
} else if (jid.hasLocalpart()) {
return jid.getUnescapedLocalpart();