[r=nik] fox npe in logger initialization

This commit is contained in:
Eugene Zhuravlev
2013-04-02 18:17:50 +04:00
parent 670f07c4f4
commit b5bba19ccc
@@ -277,28 +277,23 @@ public class BuildMain {
});
}
private static void ensureLogConfigExists(final File logConfig) {
private static void ensureLogConfigExists(final File logConfig) throws IOException {
if (!logConfig.exists()) {
FileUtil.createIfDoesntExist(logConfig);
try {
final InputStream in = BuildMain.class.getResourceAsStream("/" + DEFAULT_LOGGER_CONFIG);
if (in != null) {
final InputStream in = BuildMain.class.getResourceAsStream("/" + DEFAULT_LOGGER_CONFIG);
if (in != null) {
try {
final FileOutputStream out = new FileOutputStream(logConfig);
try {
final FileOutputStream out = new FileOutputStream(logConfig);
try {
FileUtil.copy(in, out);
}
finally {
out.close();
}
FileUtil.copy(in, out);
}
finally {
in.close();
out.close();
}
}
}
catch (IOException e) {
LOG.error(e);
finally {
in.close();
}
}
}
}