Prevent setting file priorities if file priority list length does not

equal the number of files.
This commit is contained in:
Andrew Resch 2008-06-26 15:28:09 +00:00
parent 67d156973c
commit 6a734dab69
1 changed files with 4 additions and 0 deletions

View File

@ -185,6 +185,10 @@ class Torrent:
def set_file_priorities(self, file_priorities):
log.debug("setting %s's file priorities: %s", self.torrent_id, file_priorities)
if len(file_priorities) != self.torrent_info.num_files():
log.debug("file_priorities len != num_files")
return
self.handle.prioritize_files(file_priorities)
if 0 in self.file_priorities: