Skip to content

Commit

Permalink
Fix crash when running on device.
Browse files Browse the repository at this point in the history
  • Loading branch information
pxrne committed Jul 21, 2017
1 parent 02f7f47 commit 5c13dd4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Sources/RawDevice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ internal struct RawDevice {

isSimulator = (identifier == "x86_64" || identifier == "i386")

if let simulatorIdentifier = String(validatingUTF8: getenv("SIMULATOR_MODEL_IDENTIFIER")),
isSimulator {
identifier = simulatorIdentifier
}
if isSimulator {
if let simulatorIdentifier = String(validatingUTF8: getenv("SIMULATOR_MODEL_IDENTIFIER")) {
identifier = simulatorIdentifier
}
}

let regex = try! NSRegularExpression(pattern: "^([a-zA-Z]*)(\\d+)(\\,|\\.)(\\d+)$", options: [.caseInsensitive])

Expand Down

0 comments on commit 5c13dd4

Please sign in to comment.