fix crashing issue

This commit is contained in:
John McLear 2013-01-31 21:26:22 +00:00
parent 04d92b8781
commit 6c4f78446b

View file

@ -43,7 +43,6 @@ exports.padUpdate = function (hook_name, _pad) {
exports.notifyBegin = function(padId){ exports.notifyBegin = function(padId){
console.warn("Getting "+padId); console.warn("Getting "+padId);
db.get("emailSubscription:" + padId, function(err, recipients){ // get everyone we need to email db.get("emailSubscription:" + padId, function(err, recipients){ // get everyone we need to email
console.warn(recipients);
if(recipients){ if(recipients){
async.forEach(Object.keys(recipients), function(recipient, cb){ async.forEach(Object.keys(recipients), function(recipient, cb){
console.warn("Emailing "+recipient +" about a new begin update"); console.warn("Emailing "+recipient +" about a new begin update");
@ -69,6 +68,7 @@ exports.notifyEnd = function(padId){
var changesToPad = "Functionality does not exist"; var changesToPad = "Functionality does not exist";
db.get("emailSubscription:" + padId, function(err, recipients){ // get everyone we need to email db.get("emailSubscription:" + padId, function(err, recipients){ // get everyone we need to email
if(recipients){
async.forEach(Object.keys(recipients), function(recipient, cb){ async.forEach(Object.keys(recipients), function(recipient, cb){
console.debug("Emailing "+recipient +" about a new begin update"); console.debug("Emailing "+recipient +" about a new begin update");
@ -84,6 +84,7 @@ exports.notifyEnd = function(padId){
function(err){ function(err){
}); });
}
}); });
} }