Commit 1df193bc authored by Jean Meurice's avatar Jean Meurice
Browse files

Optional check fix

parent 8a488285
Pipeline #371750 passed with stage
in 1 minute
......@@ -19,7 +19,7 @@ public class TaskProperties {
public Task build(Vehicle vehicle, OsmMap map, World world) {
Optional<EEEventProcessor> res =vehicle.eesystem.getComponentManager().getComponent(NavigationProperties.NAME);
if (res.isEmpty()) throw new IllegalArgumentException("The Vehicle Tasks need the Navigation component");
if (!res.isPresent()) throw new IllegalArgumentException("The Vehicle Tasks need the Navigation component");
EEEventProcessor r2 = res.get();
if (!(r2 instanceof Navigation)) throw new IllegalArgumentException("Expected EEComponent with name 'Navigation' to be of type Navigation.");
Task t = new Task(this, (Navigation)r2);
......
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