Google-Directions-Android icon indicating copy to clipboard operation
Google-Directions-Android copied to clipboard

java.lang.NullPointerException

Open nicolasjafelle opened this issue 9 years ago • 4 comments

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)

nicolasjafelle avatar Oct 08 '15 18:10 nicolasjafelle

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

jd-alexander avatar Oct 09 '15 23:10 jd-alexander

Sure!! Probably first I need to fix it locally in the project I am using the library and then create the pull request =D.

nicolasjafelle avatar Oct 10 '15 04:10 nicolasjafelle

Awesome thanks.

jd-alexander avatar Oct 11 '15 16:10 jd-alexander

Still looking forward to the PR Nicolas ^_^

jd-alexander avatar Oct 19 '15 17:10 jd-alexander