diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 366d22db1..806ef8068 100755 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -204,10 +204,16 @@ int main(int argc, char* argv[]) torrent_info t(e); t.print(std::cout); - std::ifstream resume_file("test.fastresume", std::ios_base::binary); - resume_file.unsetf(std::ios_base::skipws); - entry resume_data = bdecode(std::istream_iterator(resume_file) - , std::istream_iterator()); + entry resume_data; + try + { + std::ifstream resume_file("test.fastresume", std::ios_base::binary); + resume_file.unsetf(std::ios_base::skipws); + resume_data = bdecode(std::istream_iterator(resume_file) + , std::istream_iterator()); + } + catch (invalid_encoding&) + {} handles.push_back(ses.add_torrent(t, "", resume_data)); handles.back().set_max_uploads(40);