]> granicus.if.org Git - transmission/commitdiff
#4452 'Error: file.name is undefined' at file-row.js line 113 -- fixed.
authorJordan Lee <jordan@transmissionbt.com>
Mon, 29 Aug 2011 21:07:50 +0000 (21:07 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Mon, 29 Aug 2011 21:07:50 +0000 (21:07 +0000)
web/javascript/file-row.js
web/javascript/transmission.js

index 0a2881baeaa0ddfcc9c5bccb809976d876b94cb4..94c6ce55b05a930efb531505db95bd06fa9194d3 100644 (file)
@@ -110,8 +110,7 @@ FileRow.prototype =
        {
                var me = this,
                    file = torrent.getFile(i),
-                   name = file.name.substring (file.name.lastIndexOf('/')+1),
-                   root, wanted_div, pri_div, file_div, prog_div;
+                   name, root, wanted_div, pri_div, file_div, prog_div;
 
                root = document.createElement('li');
                root.id = 't' + this._torrent.getId() + 'f' + this._index;
@@ -145,9 +144,12 @@ FileRow.prototype =
                        me.firePriorityChanged(prio);
                });
 
+               name = file.name || 'Unknown';
+               name = name.substring(name.lastIndexOf('/')+1);
+               name = name.replace(/([\/_\.])/g, "$1&#8203;");
                file_div = document.createElement('div');
                file_div.className = "inspector_torrent_file_list_entry_name";
-               file_div.innerHTML = name.replace(/([\/_\.])/g, "$1&#8203;");
+               file_div.innerHTML = name;
 
                prog_div = document.createElement('div');
                prog_div.className = "inspector_torrent_file_list_entry_progress";
index 802de2dbc821f0ce3e7c35ebe2db376abdac92c8..d8b418b67553563ff8831d12e197a962f4088c5e 100644 (file)
@@ -1649,11 +1649,6 @@ Transmission.prototype =
                        return;
                }
 
-               var torrent = sel[0];
-               if (torrent === this._files_torrent)
-                       if(torrent.getFileCount() === (this._files ? this._files.length: 0))
-                               return;
-
                // build the file list
                this.clearFileList();
                this._file_torrent = torrent;