diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2023-04-26 18:06:18 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2023-05-03 16:41:55 +0200 |
| commit | 3d4e85a949c2d92a9484e354072df221c477bd63 (patch) | |
| tree | fb98ac4ac74624d28884574830d95e765bb7c656 /ios/Operations | |
| parent | 8717bfbd11f7a771adc4bed7528ff7f232e20c3e (diff) | |
| download | mullvadvpn-3d4e85a949c2d92a9484e354072df221c477bd63.tar.xz mullvadvpn-3d4e85a949c2d92a9484e354072df221c477bd63.zip | |
Operations: make transform operation does not erase initial input when input block is not provided
Diffstat (limited to 'ios/Operations')
| -rw-r--r-- | ios/Operations/TransformOperation.swift | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ios/Operations/TransformOperation.swift b/ios/Operations/TransformOperation.swift index 49361ac641..6b00bf83c3 100644 --- a/ios/Operations/TransformOperation.swift +++ b/ios/Operations/TransformOperation.swift @@ -66,11 +66,11 @@ public final class TransformOperation<Input, Output>: ResultOperation<Output>, I } override public func main() { - let inputValue = inputBlock?() - - _input = inputValue + if let inputBlock = inputBlock { + _input = inputBlock() + } - guard let inputValue = inputValue, let executionBlock = executionBlock else { + guard let inputValue = _input, let executionBlock = executionBlock else { finish(result: .failure(OperationError.unsatisfiedRequirement)) return } |
