throw if adminEmail and allowSubscriptions are not compatible

pull/1/head
ansuz 8 years ago
parent 76c530037b
commit 8507f77116

@ -373,7 +373,10 @@ var getHash = function (Env, publicKey, cb) {
// To each key is associated an object containing the 'limit' value and a 'note' explaining that limit // To each key is associated an object containing the 'limit' value and a 'note' explaining that limit
var limits = {}; var limits = {};
var updateLimits = function (config, publicKey, cb) { var updateLimits = function (config, publicKey, cb) {
if (config.adminEmail === false && config.allowSubscriptions === false) { return; } if (config.adminEmail === false) {
if (config.allowSubscriptions === false) { return; }
throw new Error("allowSubscriptions must be false if adminEmail is false");
}
if (typeof cb !== "function") { cb = function () {}; } if (typeof cb !== "function") { cb = function () {}; }
var defaultLimit = typeof(config.defaultStorageLimit) === 'number'? var defaultLimit = typeof(config.defaultStorageLimit) === 'number'?

Loading…
Cancel
Save