0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

refactor: check if the param config is boolean

This commit is contained in:
Juan Picado @jotadeveloper 2017-07-24 07:34:32 +02:00
parent 430425ce2f
commit 672589b553
No known key found for this signature in database
GPG key ID: 18AC54485952D158

View file

@ -83,7 +83,9 @@ class Storage {
// if uplink fails with a status other than 404, we report failure
if (_.isNil(err_results[i][0]) === false) {
if (err_results[i][0].status !== 404) {
if (_.isNil(this.config.publish) === false && this.config.publish.allow_offline) {
if (_.isNil(this.config.publish) === false &&
_.isBoolean(this.config.publish.allow_offline) &&
this.config.publish.allow_offline) {
return resolve();
}
return reject(Error[503]('one of the uplinks is down, refuse to publish'));