mirror of
https://github.com/ProxymanApp/atlantis.git
synced 2026-05-20 20:20:35 +00:00
Check for AVAggregateAssetDownloadTask before checking for its request (#151)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
// Copyright © 2020 Proxyman. All rights reserved.
|
||||
//
|
||||
|
||||
import class AVFoundation.AVAggregateAssetDownloadTask
|
||||
import Foundation
|
||||
|
||||
#if os(OSX)
|
||||
@@ -101,6 +102,13 @@ public final class TrafficPackage: Codable, CustomDebugStringConvertible, Serial
|
||||
// MARK: - Builder
|
||||
|
||||
static func buildRequest(sessionTask: URLSessionTask, id: String) -> TrafficPackage? {
|
||||
// If sessionTask is AVAggregateAssetDownloadTask,
|
||||
// accessing currentRequest crashes with not supported error,
|
||||
// so we need to check for it in advance.
|
||||
if sessionTask is AVAggregateAssetDownloadTask {
|
||||
return nil
|
||||
}
|
||||
|
||||
guard let currentRequest = sessionTask.currentRequest,
|
||||
let request = Request(currentRequest) else { return nil }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user