Skip to content

Commit

Permalink
fix malcommac#83: removed weak self from recover operator
Browse files Browse the repository at this point in the history
  • Loading branch information
malcommac committed Oct 8, 2020
1 parent 103c755 commit 4b604a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file not shown.
4 changes: 2 additions & 2 deletions Sources/Hydra/Promise+Recover.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public extension Promise {
/// - Returns: a promise
func recover(in context: Context? = nil, _ body: @escaping (Error) throws -> Promise<Value>) -> Promise<Value> {
let ctx = context ?? .background
return Promise<Value>(in: ctx, token: self.invalidationToken, { [weak self] resolve, reject, operation in
self?.then(in: ctx, {
return Promise<Value>(in: ctx, token: self.invalidationToken, { resolve, reject, operation in
self.then(in: ctx, {
// If promise resolve we don't need to do anything.
resolve($0)
}).catch(in: ctx, { error in
Expand Down

0 comments on commit 4b604a4

Please sign in to comment.