Skip to content

Commit

Permalink
Fix finishFileGeneration with error result.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: b4d766d6832820eb8480d09444a167bd11bc95a3
  • Loading branch information
levlam committed Aug 29, 2018
1 parent 6439cf8 commit 2b72a74
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions td/telegram/files/FileGenerateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,12 @@ class FileExternalGenerateActor : public FileGenerateActor {
check_status(do_file_generate_progress(expected_size, local_prefix_size), std::move(promise));
}
void file_generate_finish(Status status, Promise<> promise) override {
check_status(do_file_generate_finish(std::move(status)), std::move(promise));
if (status.is_error()) {
check_status(std::move(status));
return promise.set_value(Unit());
}

check_status(do_file_generate_finish(), std::move(promise));
}

private:
Expand Down Expand Up @@ -297,9 +302,7 @@ class FileExternalGenerateActor : public FileGenerateActor {
return Status::OK();
}

Status do_file_generate_finish(Status status) {
TRY_STATUS(std::move(status));

Status do_file_generate_finish() {
auto dir = get_files_dir(generate_location_.file_type_);

TRY_RESULT(perm_path, create_from_temp(path_, dir, name_));
Expand Down

0 comments on commit 2b72a74

Please sign in to comment.