Skip to content

Commit d3b7f9c

Browse files
committed
Revert "Remove implicitly unwrapped optional"
This reverts commit e5f8778.
1 parent 627c7f7 commit d3b7f9c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Foundation/URLSession/URLSessionTask.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ open class URLSessionTask : NSObject, NSCopying {
3333
internal var suspendCount = 1
3434
internal var session: URLSessionProtocol! //change to nil when task completes
3535
internal let body: _Body
36-
fileprivate var _protocol: URLProtocol? = nil
36+
fileprivate var _protocol: URLProtocol! = nil
3737
private let syncQ = DispatchQueue(label: "org.swift.URLSessionTask.SyncQ")
3838

3939
/// All operations must run on this queue.
@@ -178,8 +178,8 @@ open class URLSessionTask : NSObject, NSCopying {
178178
self.workQueue.async {
179179
let urlError = URLError(_nsError: NSError(domain: NSURLErrorDomain, code: NSURLErrorCancelled, userInfo: nil))
180180
self.error = urlError
181-
self._protocol?.stopLoading()
182-
self._protocol?.client?.urlProtocol(self._protocol!, didFailWithError: urlError)
181+
self._protocol.stopLoading()
182+
self._protocol.client?.urlProtocol(self._protocol, didFailWithError: urlError)
183183
}
184184
}
185185
}
@@ -235,7 +235,7 @@ open class URLSessionTask : NSObject, NSCopying {
235235

236236
if self.suspendCount == 1 {
237237
self.workQueue.async {
238-
self._protocol?.stopLoading()
238+
self._protocol.stopLoading()
239239
}
240240
}
241241
}
@@ -250,7 +250,7 @@ open class URLSessionTask : NSObject, NSCopying {
250250
self.updateTaskState()
251251
if self.suspendCount == 0 {
252252
self.workQueue.async {
253-
self._protocol?.startLoading()
253+
self._protocol.startLoading()
254254
}
255255
}
256256
}

0 commit comments

Comments
 (0)