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) {
console.log(err)
// :TODO: what to do exactly?????
return self.prevMenu();
}
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);
} else {
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'));
} else {
self.messageList = msgList;
@ -210,6 +210,7 @@ MessageListModule.prototype.mciReady = function(mciData, cb) {
function complete(err) {
if(err) {
self.client.log.error( { error : err.toString() }, 'Error loading message list');
}
cb(err);
}