From 9f0a87c5a51d6247fd4b1d7ea4645283c18d5303 Mon Sep 17 00:00:00 2001 From: mguessan Date: Fri, 28 Feb 2014 17:48:42 +0000 Subject: [PATCH] From coverity: use getParamValue instead of getParam().getValue() to avoid null dereference git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2235 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/VCalendar.java | 5 ++--- src/java/davmail/exchange/VProperty.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/java/davmail/exchange/VCalendar.java b/src/java/davmail/exchange/VCalendar.java index 07483121..1fa46a8f 100644 --- a/src/java/davmail/exchange/VCalendar.java +++ b/src/java/davmail/exchange/VCalendar.java @@ -479,8 +479,7 @@ public class VCalendar extends VObject { // than PARTSTAT=NEEDS-ACTION since the RSVP confuses iCal4 into // thinking the attendee has not replied if (isCurrentUser(property) && property.hasParam("RSVP", "TRUE")) { - VProperty.Param partstat = property.getParam("PARTSTAT"); - if (partstat == null || !"NEEDS-ACTION".equals(partstat.getValue())) { + if (!"NEEDS-ACTION".equals(property.getParamValue("PARTSTAT"))) { property.removeParam("RSVP"); } } @@ -733,7 +732,7 @@ public class VCalendar extends VObject { String attendeeEmail = getEmailValue(property); if (email.equalsIgnoreCase(attendeeEmail) && property.hasParam("PARTSTAT")) { // found current user attendee line - status = property.getParam("PARTSTAT").getValue(); + status = property.getParamValue("PARTSTAT"); break; } } diff --git a/src/java/davmail/exchange/VProperty.java b/src/java/davmail/exchange/VProperty.java index c03cf5b6..a0b5a5ad 100644 --- a/src/java/davmail/exchange/VProperty.java +++ b/src/java/davmail/exchange/VProperty.java @@ -47,7 +47,7 @@ public class VProperty { values.addAll(paramValues); } - public String getValue() { + protected String getValue() { if (values != null && !values.isEmpty()) { return values.get(0); } else {