prevMenu() if MenuModule load error

This commit is contained in:
Bryan Ashby 2016-06-16 22:35:27 -06:00
parent 9b2af0f90c
commit a06f721185
2 changed files with 3 additions and 1 deletions

View File

@ -132,6 +132,7 @@ function MenuModule(options) {
if(err) { if(err) {
console.log(err) console.log(err)
// :TODO: what to do exactly????? // :TODO: what to do exactly?????
return self.prevMenu();
} }
self.finishedLoading(); self.finishedLoading();

View File

@ -133,7 +133,7 @@ MessageListModule.prototype.mciReady = function(mciData, cb) {
callback(0 === self.messageList.length ? new Error('No messages in area') : null); callback(0 === self.messageList.length ? new Error('No messages in area') : null);
} else { } else {
messageArea.getMessageListForArea( { client : self.client }, self.messageAreaTag, function msgs(err, msgList) { messageArea.getMessageListForArea( { client : self.client }, self.messageAreaTag, function msgs(err, msgList) {
if(msgList && 0 === msgList.length) { if(!msgList || 0 === msgList.length) {
callback(new Error('No messages in area')); callback(new Error('No messages in area'));
} else { } else {
self.messageList = msgList; self.messageList = msgList;
@ -210,6 +210,7 @@ MessageListModule.prototype.mciReady = function(mciData, cb) {
function complete(err) { function complete(err) {
if(err) { if(err) {
self.client.log.error( { error : err.toString() }, 'Error loading message list'); self.client.log.error( { error : err.toString() }, 'Error loading message list');
} }
cb(err); cb(err);
} }