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

View File

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