From 5fd1c35d854971efe3e2171011d48c70fe4ed1da Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Fri, 1 Jun 2012 17:51:07 +0100 Subject: [PATCH] Check if container exists before updating A quick check is performed container exists before attemping update --- lib/coder.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/coder.js b/lib/coder.js index ebfa54d..85fc959 100644 --- a/lib/coder.js +++ b/lib/coder.js @@ -1501,7 +1501,7 @@ var ICEcoder = { // Show file & folder count in server info screen updateFileFolderCount: function() { - var fileText, dirText, unitSize, unitText; + var fileText, dirText, unitSize, unitText, dContainer; top.ICEcoder.dirCount > 1 ? dirText = "folders" : dirText = "folder"; top.ICEcoder.fileCount > 1 ? fileText = "files" : fileText = "file"; @@ -1514,6 +1514,9 @@ var ICEcoder = { unitText = "mb"; } // Update the display - top.ICEcoder.content.contentWindow.document.getElementById('fileFolderCounts').innerHTML = top.ICEcoder.fileCount+" "+fileText+", "+top.ICEcoder.dirCount+" "+dirText+"
~ "+unitSize+" "+unitText; + dContainer = top.ICEcoder.content.contentWindow.document.getElementById('fileFolderCounts'); + if (dContainer) { + dContainer.innerHTML = top.ICEcoder.fileCount+" "+fileText+", "+top.ICEcoder.dirCount+" "+dirText+"
~ "+unitSize+" "+unitText; + } } }; \ No newline at end of file