Skip to content

Commit

Permalink
Merge pull request #204 from mapbox/jerrad/initFromCoder-fix
Browse files Browse the repository at this point in the history
QuickFix: RouteOptions.init(coder: NSCoder)
  • Loading branch information
JThramer committed Nov 9, 2017
2 parents b9c15b5 + a5bb8bc commit 0cfa63d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions MapboxDirections/MBRouteOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,9 @@ open class RouteOptions: NSObject, NSSecureCoding, NSCopying{

includesSpokenInstructions = decoder.decodeBool(forKey: "includesSpokenInstructions")

guard let distanceMeasurementSystem = MeasurementSystem(description: decoder.decodeObject(of: NSString.self, forKey: "distanceMeasurementSystem") as String? ?? "") else {
return nil
if let distanceMeasurementSystem = MeasurementSystem(description: decoder.decodeObject(of: NSString.self, forKey: "distanceMeasurementSystem") as String? ?? "") {
self.distanceMeasurementSystem = distanceMeasurementSystem
}
self.distanceMeasurementSystem = distanceMeasurementSystem
}

open static var supportsSecureCoding = true
Expand Down

0 comments on commit 0cfa63d

Please sign in to comment.