Skip to content

Commit

Permalink
Avoid using IUO
Browse files Browse the repository at this point in the history
  • Loading branch information
giginet committed Aug 29, 2018
1 parent becf74c commit 1899c45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/CarthageKit/Simulator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ internal func selectAvailableSimulator(of sdk: SDK, from data: Data) -> Simulato
let decoder = JSONDecoder()
// simctl returns following JSON:
// {"devices": {"iOS 12.0": [<simulators...>]}]
guard let jsonObject = try? decoder.decode([String: [String: [Simulator]]].self, from: data) else {
guard let jsonObject = try? decoder.decode([String: [String: [Simulator]]].self, from: data),
let devices = jsonObject["devices"] else {
return nil
}
let platformName = sdk.platform.rawValue
let devices = jsonObject["devices"]!
let allTargetSimulators = devices
.filter { $0.key.hasPrefix(platformName) }
func sortedByVersion(_ osNames: [String]) -> [String] {
Expand Down

0 comments on commit 1899c45

Please sign in to comment.