From 694bacc4e021fca15286bf81ce3eb233e0b1fab1 Mon Sep 17 00:00:00 2001 From: mguessan Date: Mon, 30 May 2011 22:26:02 +0000 Subject: [PATCH] Caldav: Fix NullPointerException in getTimezoneIdFromExchange git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1695 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/dav/DavExchangeSession.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/java/davmail/exchange/dav/DavExchangeSession.java b/src/java/davmail/exchange/dav/DavExchangeSession.java index 7765ebcb..b8576646 100644 --- a/src/java/davmail/exchange/dav/DavExchangeSession.java +++ b/src/java/davmail/exchange/dav/DavExchangeSession.java @@ -990,7 +990,7 @@ public class DavExchangeSession extends ExchangeSession { @Override public Condition isFalse(String attributeName) { if ("Exchange2003".equals(this.serverVersion) && "deleted".equals(attributeName)) { - return or(isEqualTo(attributeName, "0"), isNull(attributeName)); + return or(isEqualTo(attributeName, "0"), isNull(attributeName)); } else { return new MonoCondition(attributeName, Operator.IsFalse); } @@ -2149,7 +2149,9 @@ public class DavExchangeSession extends ExchangeSession { byte[] roamingdictionary = getBinaryPropertyIfExists(responses[0].getProperties(HttpStatus.SC_OK), "roamingdictionary"); if (roamingdictionary != null) { timezoneName = getTimezoneNameFromRoamingDictionary(roamingdictionary); - timezoneId = ResourceBundle.getBundle("timezoneids").getString(timezoneName); + if (timezoneName != null) { + timezoneId = ResourceBundle.getBundle("timezoneids").getString(timezoneName); + } } } } catch (MissingResourceException e) { @@ -2578,8 +2580,8 @@ public class DavExchangeSession extends ExchangeSession { public int read(byte buffer[], int offset, int length) throws IOException { int count = super.read(buffer, offset, length); totalCount += count; - if (totalCount - lastLogCount > 1024*1024) { - LOGGER.debug("Downloaded " + (totalCount/1024) + " KBytes from " + method.getURI()); + if (totalCount - lastLogCount > 1024 * 1024) { + LOGGER.debug("Downloaded " + (totalCount / 1024) + " KBytes from " + method.getURI()); DavGatewayTray.switchIcon(); lastLogCount = totalCount; }