Fix segfault using non-binary cache stores as substituters

This commit is contained in:
Eelco Dolstra 2018-02-05 17:46:43 +01:00
parent 84722d67d2
commit 2175eee9fe
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -3670,7 +3670,7 @@ void SubstitutionGoal::tryNext()
/* Update the total expected download size. */
auto narInfo = std::dynamic_pointer_cast<const NarInfo>(info);
maintainExpectedNar = std::make_unique<MaintainCount<uint64_t>>(worker.expectedNarSize, narInfo->narSize);
maintainExpectedNar = std::make_unique<MaintainCount<uint64_t>>(worker.expectedNarSize, info->narSize);
maintainExpectedDownload =
narInfo && narInfo->fileSize