From 3130350f58efcc3b1789747cb39ca8d14cf2279f Mon Sep 17 00:00:00 2001 From: Sam Nicholls Date: Sun, 21 Apr 2013 15:27:08 +0100 Subject: [PATCH] Check getProfile read was successful --- modules/profile/api.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/profile/api.js b/modules/profile/api.js index 6e0b818..2bf7b05 100644 --- a/modules/profile/api.js +++ b/modules/profile/api.js @@ -31,7 +31,12 @@ var api = function(dbot) { dbot.api.users.resolveUser(server, nick, function(user){ if(user){ this.db.read('profiles', user.id, function(err, profile){ - callback(false, user, profile); + if(!err){ + callback(false, user, profile); + } + else{ + callback(true, null, null); + } }); } else{