Check if container exists before updating

A quick check is performed container exists before attemping update
This commit is contained in:
Matt Pass
2012-06-01 17:51:07 +01:00
parent 21b61bd027
commit 5fd1c35d85

View File

@@ -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+"<br>~ "+unitSize+" "+unitText;
dContainer = top.ICEcoder.content.contentWindow.document.getElementById('fileFolderCounts');
if (dContainer) {
dContainer.innerHTML = top.ICEcoder.fileCount+" "+fileText+", "+top.ICEcoder.dirCount+" "+dirText+"<br>~ "+unitSize+" "+unitText;
}
}
};