File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,9 +113,12 @@ std::string NarInfo::to_string(const StoreDirConfig & store) const
113113 res += " URL: " + url + " \n " ;
114114 assert (compression != " " );
115115 res += " Compression: " + compression + " \n " ;
116- assert (fileHash && fileHash->algo == HashAlgorithm::SHA256);
117- res += " FileHash: " + fileHash->to_string (HashFormat::Nix32, true ) + " \n " ;
118- res += " FileSize: " + std::to_string (fileSize) + " \n " ;
116+ if (fileHash) {
117+ assert (fileHash->algo == HashAlgorithm::SHA256);
118+ res += " FileHash: " + fileHash->to_string (HashFormat::Nix32, true ) + " \n " ;
119+ }
120+ if (fileSize)
121+ res += " FileSize: " + std::to_string (fileSize) + " \n " ;
119122 assert (narHash.algo == HashAlgorithm::SHA256);
120123 res += " NarHash: " + narHash.to_string (HashFormat::Nix32, true ) + " \n " ;
121124 res += " NarSize: " + std::to_string (narSize) + " \n " ;
You can’t perform that action at this time.
0 commit comments