mapbox / mapbox/mapbox-java

NullPointerException when isochrones are generated for coordinates in the middle of an ocean

Open
#1,220 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
438
Forks
117
PR merge metrics
No merged PRs in 30d

Description

For example, for the following coordinates - longitude - 0.10006148, latitude - 0.09864120000000001, I get the exception below. I am using v5.6.0 of the Java SDK.

java.lang.NullPointerException: Null type
	at com.mapbox.geojson.FeatureCollection.<init>(FeatureCollection.java:160)
	at com.mapbox.geojson.FeatureCollection$GsonTypeAdapter.read(FeatureCollection.java:385)
	at com.mapbox.geojson.FeatureCollection$GsonTypeAdapter.read(FeatureCollection.java:278)
	at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:39)
	at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:27)
	at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:225)
	at retrofit2.OkHttpCall.execute(OkHttpCall.java:188)
	at com.mapbox.core.MapboxService.executeCall(MapboxService.java:84)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stack trace in FeatureCollection.java, especially the GsonTypeAdapter.read path, and reproduce the request using the ocean coordinates from the report against Java SDK v5.6.0. Trace the response returned for that isochrone request and verify that parsing completes without the reported NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.