Google-Directions-Android
Google-Directions-Android copied to clipboard
java.lang.NullPointerException
Apparently shortestRoute is initialized in null when:
result != null but is 0
//Line 99 in AbstractRouting class
i$ = shortestRoute.getPoints().iterator(); // at this point shortestRoute is null
java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.directions.route.Route.getPoints()' on a null object reference
10-08 15:02:07.212 6045-6045/ai.home E/AndroidRuntime: at com.directions.route.AbstractRouting.onPostExecute(AbstractRouting.java:146)
10-08 15:02:07.212 6045-6045/ai.home E/AndroidRuntime: at com.directions.route.AbstractRouting.onPostExecute(AbstractRouting.java:20)
10-08 15:02:07.212 6045-6045/ai.home E/AndroidRuntime: at android.os.AsyncTask.finish(AsyncTask.java:636)
10-08 15:02:07.212 6045-6045/ai.home E/AndroidRuntime: at android.os.AsyncTask.access$500(AsyncTask.java:177)
10-08 15:02:07.212 6045-6045/ai.home E/AndroidRuntime: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:653)
10-08 15:02:07.212 6045-6045/ai.home E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
10-08 15:02:07.212 6045-6045/ai.home E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135)
10-08 15:02:07.212 6045-6045/ai.home E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5254)
10-08 15:02:07.212 6045-6045/ai.home E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-08 15:02:07.212 6045-6045/ai.home E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
10-08 15:02:07.212 6045-6045/ai.home E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
10-08 15:02:07.212 6045-6045/ai.home E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Okay. Would be nice if you submit a PR to fix the issue. Currently working on releasing my app (wakesocialapp.com) so can't touch this as yet
Sure!! Probably first I need to fix it locally in the project I am using the library and then create the pull request =D.
Awesome thanks.
Still looking forward to the PR Nicolas ^_^