opentripplanner / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
2.21k stars 1.03k forks source link

NPE for StateEditor.makeState() in ItineraryMapper.java #2930

Closed lbt05 closed 4 years ago

lbt05 commented 4 years ago

NOTE: this issue system is intended for reporting bugs and tracking progress in software development. For all other usage and software development questions or discussion, please write to one of the mailing lists (Google groups): https://groups.google.com/forum/#!forum/opentripplanner-dev https://groups.google.com/forum/#!forum/opentripplanner-users

Expected behavior

Observed behavior

java.lang.NullPointerException: null
    at org.opentripplanner.routing.edgetype.StreetEdge.traverse(StreetEdge.java:251)

Version of OTP used (exact commit hash or JAR name)

dev-2.x

Data sets in use (links to GTFS and OSM PBF files)

Command line used to start OTP

Router config and graph build config JSON

Steps to reproduce the problem

for StateEditor.makeState(), it's possible to return null as State but in ItineraryMapper.java, there's no logic to handle this situation. and when I try to debug it as s == null and execute the same code above in Evaluation Expression

 StateEditor se = new StateEditor(request, edges.get(0).getFromVertex());
            se.setTimeSeconds(startOfTime.plusSeconds(pathLeg.fromTime()).toEpochSecond());
            //se.setNonTransitOptionsFromState(states[0]);
            State s = se.makeState();

the state is not null. I'm not sure it's a concurrency issue or not...

t2gran commented 4 years ago

Hi, thank you for reporting this. Could you provide a full StackTrace, OSM and transit data files. It is not possible to reproduce the error without more information.

Thomas

lbt05 commented 4 years ago

I've found out the reason ,so I closed the issue. Well, The request only contains with TRANSIT as mode and get the exception. Logically there should be an exception for this request but I don't think it's proper as NPE. But considering this branch is still ongoing, I don't think it's an urgent issue.