mirror of
https://github.com/transmission/transmission.git
synced 2025-12-25 04:45:56 +00:00
(trunk web) make sure the torrent array doesn't change between getting the index and accessing it
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user