diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-12-20 15:21:03 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-12-20 15:21:03 +0100 |
commit | 40335785aad5362b5ef0f2a377b28819c1435b19 (patch) | |
tree | a969b7ef5dd4f9641ea820eacab55151940650c6 /src/main/java/eu/siacs | |
parent | 6b047bed97179c86e4eb733b4c123de743eb4702 (diff) |
don't include empty fingerprints in list of otrfingerprints
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Contact.java | 10 |
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 6a6b41d66..1fb80b9b2 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) { |