aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Contact.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Contact.java b/src/main/java/eu/siacs/conversations/entities/Contact.java
index 6a6b41d6..1fb80b9b 100644
--- a/src/main/java/eu/siacs/conversations/entities/Contact.java
+++ b/src/main/java/eu/siacs/conversations/entities/Contact.java
@@ -266,13 +266,15 @@ public class Contact implements ListItem {
}
public ArrayList<String> getOtrFingerprints() {
- ArrayList<String> fingerprints = new ArrayList<String>();
+ final ArrayList<String> fingerprints = new ArrayList<String>();
try {
if (this.keys.has("otr_fingerprints")) {
- JSONArray prints = this.keys
- .getJSONArray("otr_fingerprints");
+ final JSONArray prints = this.keys.getJSONArray("otr_fingerprints");
for (int i = 0; i < prints.length(); ++i) {
- fingerprints.add(prints.getString(i));
+ final String print = prints.getString(i);
+ if (print != null && !print.isEmpty()) {
+ fingerprints.add(prints.getString(i));
+ }
}
}
} catch (final JSONException ignored) {