From 0c1e7642d9375df5ac99ae80733b5e6b16fecc80 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Tue, 13 Aug 2013 14:51:39 -0400 Subject: [PATCH] Add some conditions that should prevent logging errors --- channel.js | 6 ++++-- server.js | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/channel.js b/channel.js index 52c7975f..c85ced24 100644 --- a/channel.js +++ b/channel.js @@ -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++) { diff --git a/server.js b/server.js index 9ce5b3ec..1ff32018 100644 --- a/server.js +++ b/server.js @@ -63,6 +63,7 @@ var Server = { } } chan.name = ""; + chan.canonical_name = ""; }, stats: null, app: null,