From 78bcba17d9d404cfd67bd8ecba2305ebd08ab532 Mon Sep 17 00:00:00 2001 From: "kh5325.kim" Date: Wed, 17 Apr 2013 11:56:55 +0900 Subject: [PATCH] Fixed FileAppender is null --- .../ui/page/preference/TizenBasePreferencePage.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/org.tizen.common/src/org/tizen/common/ui/page/preference/TizenBasePreferencePage.java b/org.tizen.common/src/org/tizen/common/ui/page/preference/TizenBasePreferencePage.java index a9ed253..86b7a80 100644 --- a/org.tizen.common/src/org/tizen/common/ui/page/preference/TizenBasePreferencePage.java +++ b/org.tizen.common/src/org/tizen/common/ui/page/preference/TizenBasePreferencePage.java @@ -390,14 +390,18 @@ public class TizenBasePreferencePage extends FieldEditorPreferencePage implement MDC.put(LoggerConstants.KEY_SDK_HOME, InstallPathConfig.getSDKPath()); Logger rootLogger = Logger.getRootLogger(); FileAppender fileAppender = (FileAppender) rootLogger.getAppender(LoggerConstants.NAME_FILE_APPENDER); - String result = fileAppender.setFilePath(loggerLoc); - MDC.remove(LoggerConstants.KEY_SDK_HOME); - MDC.remove(LoggerConstants.KEY_WORKSPACE); - - if(!StringUtil.isEmpty(result)) { - setErrorMessage(result); - applyOk = false; - return; + try { + if (fileAppender != null) { + String result = fileAppender.setFilePath(loggerLoc); + if(!StringUtil.isEmpty(result)) { + setErrorMessage(result); + applyOk = false; + return; + } + } + } finally { + MDC.remove(LoggerConstants.KEY_SDK_HOME); + MDC.remove(LoggerConstants.KEY_WORKSPACE); } prefStore.setValue(OPTION_ID_LOCATION, loggerLocText.getText()); -- 2.7.4