Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore empty image URLs #322

Merged
merged 1 commit into from
Dec 6, 2018
Merged

Ignore empty image URLs #322

merged 1 commit into from
Dec 6, 2018

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Dec 6, 2018

Fixed an issue where VisualInstructionComponent(json:) would set VisualInstructionComponent.imageURL to an invalid URL when the JSON representation includes an empty image URL. URL(string:) already returns nil for invalid URLs, but appending the resolution and file extension onto an empty string made the string into a valid URL – a relative file URL that would be invalid for an HTTP connection.

/cc @mapbox/navigation-ios @kevinkreiser

@1ec5 1ec5 added the bug label Dec 6, 2018
@1ec5 1ec5 self-assigned this Dec 6, 2018
"imageURL": "",
])
XCTAssertEqual(component.text, "Take a hike")
XCTAssertNil(component.imageURL)

This comment was marked as resolved.

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants