aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-12-20 15:21:03 +0100
committeriNPUTmice <daniel@gultsch.de>2014-12-20 15:21:03 +0100
commit40335785aad5362b5ef0f2a377b28819c1435b19 (patch)
treea969b7ef5dd4f9641ea820eacab55151940650c6 /src
parent6b047bed97179c86e4eb733b4c123de743eb4702 (diff)
don't include empty fingerprints in list of otrfingerprints
Diffstat (limited to 'src')
-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) {