fixed potential problem in storage where it sometimes checks files without first initializing

This commit is contained in:
Arvid Norberg 2008-12-13 03:32:57 +00:00
parent aced1fcac3
commit eb1de9d9eb
1 changed files with 2 additions and 0 deletions

View File

@ -1900,6 +1900,8 @@ namespace libtorrent
// is finished // is finished
int piece_manager::check_files(int& current_slot, int& have_piece, std::string& error) int piece_manager::check_files(int& current_slot, int& have_piece, std::string& error)
{ {
if (m_state == state_none) return check_no_fastresume(error);
TORRENT_ASSERT(int(m_piece_to_slot.size()) == m_files.num_pieces()); TORRENT_ASSERT(int(m_piece_to_slot.size()) == m_files.num_pieces());
current_slot = m_current_slot; current_slot = m_current_slot;