diff --git a/modules/profile/api.js b/modules/profile/api.js index b19a693..781ce12 100644 --- a/modules/profile/api.js +++ b/modules/profile/api.js @@ -9,6 +9,7 @@ var api = function(dbot) { * TODO(@samstudio8) Migrate to internalAPI */ "createProfile": function(user, callback){ + if(!callback) callback = function(){}; if(user){ this.db.create('profiles', user.id, { 'id': user.id, diff --git a/modules/warning/pages.js b/modules/warning/pages.js index cb105fa..cb24623 100644 --- a/modules/warning/pages.js +++ b/modules/warning/pages.js @@ -22,7 +22,11 @@ var pages = function(dbot) { }, function(err) { async.eachSeries(userIds, function(id, callback) { dbot.api.users.getUser(id, function(err, user) { - userNicks.push(user.primaryNick); + if(user) { + userNicks.push(user.primaryNick); + } else { + userNicks.push(id); + } callback(false); }); }, function(err) {