summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2018-02-06 11:18:32 -0500
committerGitHub <noreply@github.com>2018-02-06 11:18:32 -0500
commit273a78c419a9a7c77b609fd5617f45b9f078712a (patch)
tree48252c079570eb9fe1114ce1cbfb0f22ee53e3b6
parent882aa24b31f92119f600a8fdc0b50dca7dec1d71 (diff)
parent373f16461511fcd4bab935dbe3cd6323dacef2d1 (diff)
downloadsdl_ios-273a78c419a9a7c77b609fd5617f45b9f078712a.tar.gz
Merge pull request #861 from t-yoshii/fix/finish-operation-on-fail
finish operation when error occurred in SDLUploadFileOperation
-rw-r--r--SmartDeviceLink/SDLUploadFileOperation.m3
1 files changed, 3 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLUploadFileOperation.m b/SmartDeviceLink/SDLUploadFileOperation.m
index fda100fab..fbeac9431 100644
--- a/SmartDeviceLink/SDLUploadFileOperation.m
+++ b/SmartDeviceLink/SDLUploadFileOperation.m
@@ -70,10 +70,12 @@ NS_ASSUME_NONNULL_BEGIN
__block NSInteger highestCorrelationIDReceived = -1;
if (self.isCancelled) {
+ [self finishOperation];
return completion(NO, bytesAvailable, [NSError sdl_fileManager_fileUploadCanceled]);
}
if (file == nil) {
+ [self finishOperation];
return completion(NO, bytesAvailable, [NSError sdl_fileManager_fileDoesNotExistError]);
}
@@ -81,6 +83,7 @@ NS_ASSUME_NONNULL_BEGIN
if (self.inputStream == nil || ![self.inputStream hasBytesAvailable]) {
// If the file does not exist or the passed data is nil, return an error
[self sdl_closeInputStream];
+ [self finishOperation];
return completion(NO, bytesAvailable, [NSError sdl_fileManager_fileDoesNotExistError]);
}