From 75a485cbc137b52bf2de7f395b05a5ebf66e050f Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 16 Nov 2017 12:47:49 +0100 Subject: [PATCH] catch all sorts of date parsing errors --- src/main/java/eu/siacs/conversations/parser/AbstractParser.java | 2 +- src/main/java/eu/siacs/conversations/parser/PresenceParser.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/parser/AbstractParser.java b/src/main/java/eu/siacs/conversations/parser/AbstractParser.java index 50ad7f38c..6e1e5ae5f 100644 --- a/src/main/java/eu/siacs/conversations/parser/AbstractParser.java +++ b/src/main/java/eu/siacs/conversations/parser/AbstractParser.java @@ -47,7 +47,7 @@ public abstract class AbstractParser { try { min = Math.min(min,AbstractParser.parseTimestamp(stamp)); returnDefault = false; - } catch (ParseException e) { + } catch (Throwable t) { //ignore } } diff --git a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java index 72dffc4da..972ac5fd3 100644 --- a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java +++ b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java @@ -226,7 +226,7 @@ public class PresenceParser extends AbstractParser implements final String since = idle.getAttribute("since"); contact.setLastseen(AbstractParser.parseTimestamp(since)); contact.flagInactive(); - } catch (NullPointerException | ParseException e) { + } catch (Throwable throwable) { if (contact.setLastseen(AbstractParser.parseTimestamp(packet))) { contact.flagActive(); }