better handling of missing config; closes #22
This commit is contained in:
parent
fc08c91fac
commit
b9ecb4db41
|
@ -28116,7 +28116,9 @@ module.exports = function(cb) {
|
|||
wait = true;
|
||||
return request.config(function(err, result) {
|
||||
var field, k, v, validator;
|
||||
config = (err ? {} : result);
|
||||
if (err || !_.isObject(result)) {
|
||||
config = {};
|
||||
}
|
||||
for (k in defaults) {
|
||||
v = defaults[k];
|
||||
if (config[k] == null) {
|
||||
|
|
|
@ -44,7 +44,7 @@ module.exports = (cb) ->
|
|||
# Make the request.
|
||||
request.config (err, result) ->
|
||||
# We do not strictly require config files.
|
||||
config = ( if err then { } else result )
|
||||
config = {} if err or not _.isObject result
|
||||
|
||||
# Tack on defaults?
|
||||
( config[k] ?= v for k, v of defaults )
|
||||
|
|
Loading…
Reference in New Issue