0

Here is my code from the main file (Airport.java) in java

AirportMarker airSource = airports.get(source);
AirportMarker airDest = airports.get(dest);

SimpleLinesMarker sl = new SimpleLinesMarker(route.getLocations(), route.getProperties());
                
airSource.addRoute(sl);
airDest.addRoute(sl);

and here is the class AirportMarker

public static List<SimpleLinesMarker> routes;

public void addRoute(SimpleLinesMarker route) {

    routes.add(route);
};

and here is the error

Unfolding Map v0.9.7 (UCSD edition)
No OpenGL renderer. Using Java2DMapDisplay.
Exception in thread "Animation Thread" java.lang.NullPointerException
    at module6.AirportMarker.addRoute(AirportMarker.java:102)
    at module6.AirportMap.setup(AirportMap.java:130)
    at processing.core.PApplet.handleDraw(PApplet.java:2365)
    at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:245)
    at processing.core.PApplet.run(PApplet.java:2260)
    at java.lang.Thread.run(Thread.java:748)

What is the error I am getting?

abhiramrp
  • 99
  • 6

0 Answers0