diff --git a/repertory/librepertory/src/file_manager/open_file.cpp b/repertory/librepertory/src/file_manager/open_file.cpp index a93ba299..fd9e0d71 100644 --- a/repertory/librepertory/src/file_manager/open_file.cpp +++ b/repertory/librepertory/src/file_manager/open_file.cpp @@ -108,13 +108,14 @@ void open_file::download_chunk(std::size_t chunk, bool skip_active, if ((get_api_error() == api_error::success) && (chunk < read_state_.size()) && not read_state_[chunk]) { if (active_downloads_.find(chunk) != active_downloads_.end()) { - if (not skip_active) { - auto active_download = active_downloads_.at(chunk); - download_lock.unlock(); - - active_download->wait(); + if (skip_active) { + return; } + auto active_download = active_downloads_.at(chunk); + download_lock.unlock(); + + active_download->wait(); return; }