mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +00:00
(trunk web) make sure the torrent array doesn't change between getting the index and accessing it
This commit is contained in:
parent
38a032b1bf
commit
cbd95c8680
1 changed files with 3 additions and 2 deletions
|
@ -642,8 +642,9 @@ Torrent.indexOf = function( torrents, id )
|
|||
*/
|
||||
Torrent.lookup = function( torrents, id )
|
||||
{
|
||||
var pos = Torrent.indexOf( torrents, id );
|
||||
return pos >= 0 ? torrents[pos] : null;
|
||||
var immutable_array = torrents.slice();
|
||||
var pos = Torrent.indexOf( immutable_array, id );
|
||||
return pos >= 0 ? immutable_array[pos] : null;
|
||||
};
|
||||
|
||||
function TorrentFile(file_data) {
|
||||
|
|
Loading…
Reference in a new issue