Commit 77becfe2 authored by Michel Schudel's avatar Michel Schudel

made peers code more symmetrical

parent 2a9f3254
...@@ -55,7 +55,13 @@ public class Network { ...@@ -55,7 +55,13 @@ public class Network {
} }
public void init() { public void init() {
this.peers = genericRepository.load(Peers.class).orElse(new Peers()); Optional<Peers> peers = genericRepository.load(Peers.class);
if (!peers.isPresent()) {
this.peers = new Peers();
genericRepository.save(this.peers);
} else {
this.peers = peers.get();
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment