Bug Report
Expected Behavior
MapboxDirections.Builder#build() should not throw exception when approaches array is empty.
Current Behavior
MapboxDirections.Builder#build() throws ServicesException exception when approaches array is empty.
Possible Solution
Cause of this issue is we trying to compare size of approaches and coordinates. But actually, we should compare size of approaches and waypointIndices.
Steps to Reproduce
- Set
approaches as empty array.
- Call
MapboxDirections#build() method.
Context (Environment)
We want to avoid using nullable types in Navigation SDK. So before we set nulls (waypointIndices, waypointNames, approaches) to builder and it works, but now we will send empty arrays instead of nulls.