handles lack of 'adler32' key in fast resume data

This commit is contained in:
Arvid Norberg 2008-02-09 19:51:23 +00:00
parent 8cf0510144
commit a16d592ff4
1 changed files with 3 additions and 2 deletions

View File

@ -2686,10 +2686,11 @@ namespace detail
, torrent_ptr->block_size()
, p.info);
const entry& ad = (*i)["adler32"];
const entry* ad = i->find_key("adler32");
// crc's didn't match, don't use the resume data
if (ad.integer() != entry::integer_type(adler))
if (ad && ad->type() == entry::int_t
&& ad->integer() != entry::integer_type(adler))
{
error = "checksum mismatch on piece "
+ boost::lexical_cast<std::string>(p.index);