diff options
author | Takamitsu Yoshii <tyoshii@xevo.com> | 2018-02-06 10:46:26 +0900 |
---|---|---|
committer | Takamitsu Yoshii <tyoshii@xevo.com> | 2018-02-06 12:34:44 +0900 |
commit | 373f16461511fcd4bab935dbe3cd6323dacef2d1 (patch) | |
tree | 48252c079570eb9fe1114ce1cbfb0f22ee53e3b6 | |
parent | 882aa24b31f92119f600a8fdc0b50dca7dec1d71 (diff) | |
download | sdl_ios-373f16461511fcd4bab935dbe3cd6323dacef2d1.tar.gz |
add finish operation when error occurred on uploading file
-rw-r--r-- | SmartDeviceLink/SDLUploadFileOperation.m | 3 |
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]); } |