diff --git a/ChangeLog b/ChangeLog index b569bafc1..a513e6f7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -51,6 +51,7 @@ * almost completely changed the storage interface (for custom storage) * added support for hashing pieces in multiple threads + * fix bug in python binding for file_progress on torrents with no metadata * fix assert when removing a connected web seed * fix bug in tracker timeout logic * switch UPnP post back to HTTP 1.1 diff --git a/bindings/python/src/torrent_handle.cpp b/bindings/python/src/torrent_handle.cpp index a0c4ae107..710fb154c 100644 --- a/bindings/python/src/torrent_handle.cpp +++ b/bindings/python/src/torrent_handle.cpp @@ -83,8 +83,12 @@ list file_progress(torrent_handle& handle, int flags) { allow_threading_guard guard; - p.reserve(handle.torrent_file()->num_files()); - handle.file_progress(p, flags); + boost::intrusive_ptr ti = handle.torrent_file(); + if (ti) + { + p.reserve(ti->num_files()); + handle.file_progress(p, flags); + } } list result;