diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-09-03 20:31:32 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-09-03 20:31:32 +0200 |
commit | be82ac563323ed83427b3ad692650c8283ce5338 (patch) | |
tree | 53dfcd82ec65e0b523c3790c3b57539a2aa0442b /src/main/java/de/pixart/messenger/entities | |
parent | 4aa24e84c49348f8d96c273f77a636557dbb40a2 (diff) |
fix some crashes
Diffstat (limited to 'src/main/java/de/pixart/messenger/entities')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Conversation.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/ReadByMarker.java | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java index 943d7f45e..a43899663 100644 --- a/src/main/java/de/pixart/messenger/entities/Conversation.java +++ b/src/main/java/de/pixart/messenger/entities/Conversation.java @@ -737,7 +737,9 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl } DSAPublicKey remotePubKey = (DSAPublicKey) getOtrSession().getRemotePublicKey(); this.otrFingerprint = getAccount().getOtrService().getFingerprint(remotePubKey).toLowerCase(Locale.US); - } catch (final OtrCryptoException | UnsupportedOperationException ignored) { + } catch (final OtrCryptoException ignored) { + return null; + } catch (final UnsupportedOperationException ignored) { return null; } } diff --git a/src/main/java/de/pixart/messenger/entities/ReadByMarker.java b/src/main/java/de/pixart/messenger/entities/ReadByMarker.java index 86057c680..113c418ba 100644 --- a/src/main/java/de/pixart/messenger/entities/ReadByMarker.java +++ b/src/main/java/de/pixart/messenger/entities/ReadByMarker.java @@ -111,12 +111,16 @@ public class ReadByMarker { ReadByMarker marker = new ReadByMarker(); try { marker.fullJid = Jid.of(jsonObject.getString("fullJid")); - } catch (JSONException | IllegalArgumentException e) { + } catch (JSONException e) { + marker.fullJid = null; + } catch (IllegalArgumentException e) { marker.fullJid = null; } try { marker.realJid = Jid.of(jsonObject.getString("realJid")); - } catch (JSONException | IllegalArgumentException e) { + } catch (JSONException e) { + marker.realJid = null; + } catch (IllegalArgumentException e) { marker.realJid = null; } return marker; @@ -125,7 +129,9 @@ public class ReadByMarker { public static Set<ReadByMarker> fromJsonString(String json) { try { return fromJson(new JSONArray(json)); - } catch (JSONException | NullPointerException e) { + } catch (JSONException e) { + return new HashSet<>(); + } catch (NullPointerException e) { return new HashSet<>(); } } |