1
0
Fork 0
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:
Kevin Glowacz 2009-06-06 22:17:24 +00:00
parent 38a032b1bf
commit cbd95c8680

View file

@ -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) {