1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-14 03:32:22 -05:00

Fix empty setting behavior: return null instead of empty string

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@964 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-03-21 20:45:09 +00:00
parent 3bb0dde31e
commit 2b758b1dc1
2 changed files with 7 additions and 2 deletions

View File

@ -280,7 +280,12 @@ public final class Settings {
* @return property value * @return property value
*/ */
public static synchronized String getProperty(String property) { public static synchronized String getProperty(String property) {
return SETTINGS.getProperty(property); String value = SETTINGS.getProperty(property);
// return null on empty value
if (value != null && value.length() == 0) {
value = null;
}
return value;
} }
/** /**

View File

@ -87,7 +87,7 @@ public final class ExchangeSessionFactory {
// prepend default windows domain prefix // prepend default windows domain prefix
String defaultDomain = Settings.getProperty("davmail.defaultDomain"); String defaultDomain = Settings.getProperty("davmail.defaultDomain");
if (userName.indexOf('\\') < 0 && defaultDomain != null && defaultDomain.length() > 0) { if (userName.indexOf('\\') < 0 && defaultDomain != null) {
userName = defaultDomain + '\\' + userName; userName = defaultDomain + '\\' + userName;
} }
PoolKey poolKey = new PoolKey(baseUrl, userName, password); PoolKey poolKey = new PoolKey(baseUrl, userName, password);