mirror of
https://github.com/moparisthebest/davmail
synced 2025-03-04 11:19:43 -05:00
configFilePath is null in some test cases
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1517 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
4547ee7870
commit
cf98558e81
@ -259,7 +259,7 @@ public final class Settings {
|
|||||||
|
|
||||||
// disable ConsoleAppender in gui mode
|
// disable ConsoleAppender in gui mode
|
||||||
if (!Settings.getBooleanProperty("davmail.server")) {
|
if (!Settings.getBooleanProperty("davmail.server")) {
|
||||||
ConsoleAppender consoleAppender = (ConsoleAppender)rootLogger.getAppender("ConsoleAppender");
|
ConsoleAppender consoleAppender = (ConsoleAppender) rootLogger.getAppender("ConsoleAppender");
|
||||||
if (consoleAppender != null) {
|
if (consoleAppender != null) {
|
||||||
consoleAppender.setThreshold(Level.OFF);
|
consoleAppender.setThreshold(Level.OFF);
|
||||||
}
|
}
|
||||||
@ -280,18 +280,21 @@ public final class Settings {
|
|||||||
* Save settings in current file path (command line or default).
|
* Save settings in current file path (command line or default).
|
||||||
*/
|
*/
|
||||||
public static synchronized void save() {
|
public static synchronized void save() {
|
||||||
FileOutputStream fileOutputStream = null;
|
// configFilePath is null in some test cases
|
||||||
try {
|
if (configFilePath != null) {
|
||||||
fileOutputStream = new FileOutputStream(configFilePath);
|
FileOutputStream fileOutputStream = null;
|
||||||
SETTINGS.store(fileOutputStream, "DavMail settings");
|
try {
|
||||||
} catch (IOException e) {
|
fileOutputStream = new FileOutputStream(configFilePath);
|
||||||
DavGatewayTray.error(new BundleMessage("LOG_UNABLE_TO_STORE_SETTINGS"), e);
|
SETTINGS.store(fileOutputStream, "DavMail settings");
|
||||||
} finally {
|
} catch (IOException e) {
|
||||||
if (fileOutputStream != null) {
|
DavGatewayTray.error(new BundleMessage("LOG_UNABLE_TO_STORE_SETTINGS"), e);
|
||||||
try {
|
} finally {
|
||||||
fileOutputStream.close();
|
if (fileOutputStream != null) {
|
||||||
} catch (IOException e) {
|
try {
|
||||||
DavGatewayTray.debug(new BundleMessage("LOG_ERROR_CLOSING_CONFIG_FILE"), e);
|
fileOutputStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
DavGatewayTray.debug(new BundleMessage("LOG_ERROR_CLOSING_CONFIG_FILE"), e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user