avoid verbose console output if settings file is not present

This commit is contained in:
hneemann 2017-06-26 22:51:45 +02:00
parent faf4844b63
commit be2ad8319e

View File

@ -51,11 +51,13 @@ public final class Settings implements AttributeListener {
filename = new File(new File(System.getProperty("user.home")), ".digital.cfg");
ElementAttributes attr = null;
XStream xStream = Circuit.getxStream();
try (InputStream in = new FileInputStream(filename)) {
attr = (ElementAttributes) xStream.fromXML(in);
} catch (Exception e) {
e.printStackTrace();
if (filename.exists()) {
XStream xStream = Circuit.getxStream();
try (InputStream in = new FileInputStream(filename)) {
attr = (ElementAttributes) xStream.fromXML(in);
} catch (Exception e) {
e.printStackTrace();
}
}
if (attr == null) {