Skip to content

Commit

Permalink
Crash fix
Browse files Browse the repository at this point in the history
  • Loading branch information
renssies committed Oct 26, 2017
1 parent ed0ac09 commit 8011587
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Ocarina/OcarinaManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ extension OcarinaManager: URLSessionDataDelegate {
completionHandler(URLSession.ResponseDisposition.allow)
}

public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
// Note: Using optional `Data` to fix a crash: https://github.com/Alamofire/Alamofire/issues/2138
public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data?) {
guard let data = data else { return }
self.barrierQueue.sync {
if var existingData = self.dataPerTask[dataTask.taskIdentifier] {
existingData.append(data)
Expand Down

0 comments on commit 8011587

Please sign in to comment.