Add some conditions that should prevent logging errors

This commit is contained in:
calzoneman 2013-08-13 14:51:39 -04:00
parent 8a10f82089
commit 0c1e7642d9
2 changed files with 5 additions and 2 deletions

View file

@ -143,7 +143,9 @@ Channel.prototype.hasPermission = function(user, key) {
/* REGION Channel data */
Channel.prototype.loadDump = function() {
var self = this;
fs.stat("chandump/" + this.name, function (err, stats) {
if(self.name === "")
return;
fs.stat("chandump/" + self.name, function (err, stats) {
if(!err) {
var mb = stats.size / 1048576;
mb = parseInt(mb * 100) / 100;
@ -263,7 +265,7 @@ Channel.prototype.loadDump = function() {
}
Channel.prototype.saveDump = function() {
if(!this.initialized)
if(!this.initialized || this.name === "")
return;
var filts = new Array(this.filters.length);
for(var i = 0; i < this.filters.length; i++) {

View file

@ -63,6 +63,7 @@ var Server = {
}
}
chan.name = "";
chan.canonical_name = "";
},
stats: null,
app: null,