summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakamitsu Yoshii <tyoshii@xevo.com>2018-02-06 10:46:26 +0900
committerTakamitsu Yoshii <tyoshii@xevo.com>2018-02-06 12:34:44 +0900
commit373f16461511fcd4bab935dbe3cd6323dacef2d1 (patch)
tree48252c079570eb9fe1114ce1cbfb0f22ee53e3b6
parent882aa24b31f92119f600a8fdc0b50dca7dec1d71 (diff)
downloadsdl_ios-373f16461511fcd4bab935dbe3cd6323dacef2d1.tar.gz
add finish operation when error occurred on uploading file
-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]);
}