Changeset 8639


Ignore:
Timestamp:
Jun 6, 2009, 10:17:24 PM (13 years ago)
Author:
kjg
Message:

(trunk web) make sure the torrent array doesn't change between getting the index and accessing it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/javascript/torrent.js

    r8566 r8639  
    643643Torrent.lookup = function( torrents, id )
    644644{
    645         var pos = Torrent.indexOf( torrents, id );
    646         return pos >= 0 ? torrents[pos] : null;
     645        var immutable_array = torrents.slice();
     646        var pos = Torrent.indexOf( immutable_array, id );
     647        return pos >= 0 ? immutable_array[pos] : null;
    647648};
    648649
Note: See TracChangeset for help on using the changeset viewer.