Skip to content
This repository has been archived by the owner on Nov 22, 2020. It is now read-only.

Commit

Permalink
Update gitfame
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtSabintsev committed Apr 24, 2019
1 parent 5b38e88 commit f285333
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions gitfame
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,11 @@ private extension GitFame {
}

guard let json = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any],
let repos = json,
let repCount = repos[GFJSONConstants.publicRepos] as? Int else {
let jsonCount = json[GFJSONConstants.publicRepos] as? Int else {
return GFError.log(error: .MalformedJSON(urlString: urlString))
}

handler(repCount)
handler(jsonCount)
}.resume()
GFSemaphore.wait()
}
Expand All @@ -84,12 +83,11 @@ private extension GitFame {
return GFError.log(error: .MissingJSON(urlString: urlString))
}

guard let json = try? JSONSerialization.jsonObject(with: data, options: []) as? [Repository],
let repos = json else {
guard let json = try? JSONSerialization.jsonObject(with: data, options: []) as? [Repository] else {
return GFError.log(error: .MalformedJSON(urlString: urlString))
}

handler(repos)
handler(json)
}.resume()
}

Expand Down

0 comments on commit f285333

Please sign in to comment.