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"); filename = new File(new File(System.getProperty("user.home")), ".digital.cfg");
ElementAttributes attr = null; ElementAttributes attr = null;
XStream xStream = Circuit.getxStream(); if (filename.exists()) {
try (InputStream in = new FileInputStream(filename)) { XStream xStream = Circuit.getxStream();
attr = (ElementAttributes) xStream.fromXML(in); try (InputStream in = new FileInputStream(filename)) {
} catch (Exception e) { attr = (ElementAttributes) xStream.fromXML(in);
e.printStackTrace(); } catch (Exception e) {
e.printStackTrace();
}
} }
if (attr == null) { if (attr == null) {