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;
|
wait = true;
|
||||||
return request.config(function(err, result) {
|
return request.config(function(err, result) {
|
||||||
var field, k, v, validator;
|
var field, k, v, validator;
|
||||||
config = (err ? {} : result);
|
if (err || !_.isObject(result)) {
|
||||||
|
config = {};
|
||||||
|
}
|
||||||
for (k in defaults) {
|
for (k in defaults) {
|
||||||
v = defaults[k];
|
v = defaults[k];
|
||||||
if (config[k] == null) {
|
if (config[k] == null) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ module.exports = (cb) ->
|
||||||
# Make the request.
|
# Make the request.
|
||||||
request.config (err, result) ->
|
request.config (err, result) ->
|
||||||
# We do not strictly require config files.
|
# We do not strictly require config files.
|
||||||
config = ( if err then { } else result )
|
config = {} if err or not _.isObject result
|
||||||
|
|
||||||
# Tack on defaults?
|
# Tack on defaults?
|
||||||
( config[k] ?= v for k, v of defaults )
|
( config[k] ?= v for k, v of defaults )
|
||||||
|
|
Loading…
Reference in New Issue