File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,10 @@ open class URLSessionTask : NSObject, NSCopying {
256
256
open func resume( ) {
257
257
workQueue. sync {
258
258
self . suspendCount -= 1
259
- guard 0 <= self . suspendCount else { fatalError ( " Resuming a task that's not suspended. Calls to resume() / suspend() need to be matched. " ) }
259
+ guard 0 <= self . suspendCount else {
260
+ assert ( false , " Resuming a task that's not suspended. Calls to resume() / suspend() need to be matched. " )
261
+ return
262
+ }
260
263
self . updateTaskState ( )
261
264
if self . suspendCount == 0 {
262
265
self . workQueue. async {
@@ -657,7 +660,10 @@ extension _ProtocolClient: URLProtocolClient {
657
660
func urlProtocolDidFinishLoading( _ protocol: URLProtocol ) {
658
661
guard let task = `protocol`. task else { fatalError ( " task cannot be nil " ) }
659
662
guard let session = task. session as? URLSession else { fatalError ( " session cannot be nil " ) }
660
- guard let response = task. response as? HTTPURLResponse else { fatalError ( " No response " ) }
663
+ guard let response = task. response as? HTTPURLResponse else {
664
+ assert ( false , " No response " )
665
+ return
666
+ }
661
667
662
668
663
669
if response. statusCode == 401 , `protocol`. containsTaskDelegate ( ) {
You can’t perform that action at this time.
0 commit comments