From eaed630ea4ded7634fc5ca8b764b12fcd66fd6aa Mon Sep 17 00:00:00 2001 From: mguessan Date: Thu, 14 Jan 2010 09:46:48 +0000 Subject: [PATCH] Caldav: Fix invalid event handling, exclude events from returned list git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@910 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ExchangeSession.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index d67479e0..8c41357f 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -2481,7 +2481,13 @@ public class ExchangeSession { String instancetype = getPropertyIfExists(response.getProperties(HttpStatus.SC_OK), "instancetype", Namespace.getNamespace("urn:schemas:calendar:")); Event event = buildEvent(response); if (instancetype == null && event.getICS() == null) { - LOGGER.warn("Invalid event found at " + response.getHref()); + // check ics content + try { + event.getICS(); + } catch (IOException e) { + // invalid event: exclude from list + LOGGER.warn("Invalid event found at " + response.getHref(), e); + } } else { events.add(event); }