From 4803b12a097b0fac14fff91242ed2bbed3f4fb33 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Mon, 29 Aug 2011 21:07:50 +0000 Subject: [PATCH] #4452 'Error: file.name is undefined' at file-row.js line 113 -- fixed. --- web/javascript/file-row.js | 8 +++++--- web/javascript/transmission.js | 5 ----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/web/javascript/file-row.js b/web/javascript/file-row.js index 0a2881bae..94c6ce55b 100644 --- a/web/javascript/file-row.js +++ b/web/javascript/file-row.js @@ -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​"); file_div = document.createElement('div'); file_div.className = "inspector_torrent_file_list_entry_name"; - file_div.innerHTML = name.replace(/([\/_\.])/g, "$1​"); + file_div.innerHTML = name; prog_div = document.createElement('div'); prog_div.className = "inspector_torrent_file_list_entry_progress"; diff --git a/web/javascript/transmission.js b/web/javascript/transmission.js index 802de2dbc..d8b418b67 100644 --- a/web/javascript/transmission.js +++ b/web/javascript/transmission.js @@ -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; -- 2.40.0