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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid force unwrapping driving side #233

Merged
merged 2 commits into from
Jan 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
opt_in_rules:
- force_unwrapping
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
2 changes: 1 addition & 1 deletion MapboxDirections/MBRouteStep.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ internal class RouteStepV4: RouteStep {
let maneuverType = ManeuverType(v4Description: maneuver["type"] as! String) ?? .none
let maneuverDirection = ManeuverDirection(v4TypeDescription: maneuver["type"] as! String) ?? .none
let maneuverLocation = CLLocationCoordinate2D(geoJSON: maneuver["location"] as! JSONDictionary)
let drivingSide = DrivingSide(description: json["driving_side"] as! String) ?? .right
let drivingSide = DrivingSide(description: json["driving_side"] as? String ?? "") ?? .right
let name = json["way_name"] as! String

self.init(finalHeading: heading, maneuverType: maneuverType, maneuverDirection: maneuverDirection, drivingSide: drivingSide, maneuverLocation: maneuverLocation, name: name, coordinates: nil, json: json)
Expand Down