From cbd95c8680c21ac7a0e8973b4c19e065799159ca Mon Sep 17 00:00:00 2001 From: Kevin Glowacz Date: Sat, 6 Jun 2009 22:17:24 +0000 Subject: [PATCH] (trunk web) make sure the torrent array doesn't change between getting the index and accessing it --- web/javascript/torrent.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/javascript/torrent.js b/web/javascript/torrent.js index 55a3a53e2..3d84a9782 100644 --- a/web/javascript/torrent.js +++ b/web/javascript/torrent.js @@ -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) {