Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Commit 0b424a0

Browse files
committed
fiexed silly error with hitting an org that doesn't exist
1 parent 8a013bd commit 0b424a0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
port: process.env.PORT || 3000,
2+
port: process.env.PORT || 6696,
33
mongo: {
44
uri: process.env.MONGOLAB_URI || 'mongodb://localhost/attendance',
55
},

routes/orgs.js

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ exports.details = function(req, res, next) {
3737
models.Org.findOne({slug: req.params.slug}, cb);
3838
},
3939
function(org, cb){
40+
if (!org){
41+
return cb("Org '"+ req.params.slug +"' was not found");
42+
}
4043
//find all events for the org, sort from latest to earliest, limit to 10
4144
models.Event.find({org:org._id})
4245
.sort('-start_time').limit(10).exec(function(err, events){

0 commit comments

Comments
 (0)