diff --git a/src/Network/Resources.cpp b/src/Network/Resources.cpp index 57fb8d9..aa47453 100644 --- a/src/Network/Resources.cpp +++ b/src/Network/Resources.cpp @@ -217,6 +217,13 @@ std::vector MultiDownload(SOCKET MSock, SOCKET DSock, uint64_t Size, const return {}; } + // ensure that GRcv is good before joining the async update thread + GRcv = MData.size() + DData.size(); + if (GRcv != Size) { + error("Something went wrong during download; didn't get enough data. Expected " + std::to_string(Size) + " bytes, got " + std::to_string(GRcv) + " bytes instead"); + return {}; + } + Au.join(); std::vector Result{};