diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer2/TraceManager.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer2/TraceManager.java index 5ffc4314..51c8df5d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer2/TraceManager.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer2/TraceManager.java @@ -85,8 +85,11 @@ public class TraceManager implements Listener { * @param id id of the trace * @return the trace with given id or null if no trace with id is found */ - public Trace get(int id){ - return traces.getOrDefault(id, null); + public Optional get(int id){ + Trace ret = traces.get(id); + if(traces.containsKey(id)) + return Optional.of(traces.get(id)); + return Optional.empty(); } /** Methode to get all traces