Skip to content
Permalink
Browse files

make sure env.enable is set before trying to use it

  • Loading branch information...
Jason Calabrese
Jason Calabrese committed Sep 9, 2014
1 parent 6a34508 commit a95785562423713a75bebbf29ddf29677bcee4b0
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/api/index.js
@@ -18,11 +18,13 @@ function create (env, entries, settings, treatments, devicestatus) {
app.enable('api');
}

env.enable.toLowerCase().split(' ').forEach(function(value) {
var enable = value.trim();
console.info("enabling feature:", enable);
app.enable(enable);
});
if (env.enable) {
env.enable.toLowerCase().split(' ').forEach(function (value) {
var enable = value.trim();
console.info("enabling feature:", enable);
app.enable(enable);
});
}

app.set('title', [app.get('name'), 'API', app.get('version')].join(' '));

0 comments on commit a957855

Please sign in to comment.
You can’t perform that action at this time.