diff --git a/src/java/davmail/util/StringUtil.java b/src/java/davmail/util/StringUtil.java index a7b7ea39..f24a9fd1 100644 --- a/src/java/davmail/util/StringUtil.java +++ b/src/java/davmail/util/StringUtil.java @@ -388,18 +388,21 @@ public final class StringUtil { /** * Remove quotes if present on value. + * * @param value input value * @return unquoted string */ public static String removeQuotes(String value) { String result = value; - if (result.startsWith("\"") || result.startsWith("{") || result.startsWith("(")) { - result = result.substring(1); - } - if (result.endsWith("\"") || result.endsWith("}") || result.endsWith(")")) { - result = result.substring(0, result.length() - 1); + if (result != null) { + if (result.startsWith("\"") || result.startsWith("{") || result.startsWith("(")) { + result = result.substring(1); + } + if (result.endsWith("\"") || result.endsWith("}") || result.endsWith(")")) { + result = result.substring(0, result.length() - 1); + } } return result; } - + }