Skip to content

MapboxDirections builder throws Exception when approaches is empty.  #1081

@Lebedinsky

Description

@Lebedinsky

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

  1. Set approaches as empty array.
  2. 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions