From 4332ffc7a73d88bce3b9aa1020369b340a543738 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Sat, 5 May 2018 15:35:42 +0200 Subject: [PATCH] fix: allow do not include storage if uses a storage plugin --- src/lib/config.js | 4 +--- src/lib/local-storage.js | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/config.js b/src/lib/config.js index 23be2da9a..37d0556e4 100644 --- a/src/lib/config.js +++ b/src/lib/config.js @@ -91,9 +91,7 @@ class Config { // some weird shell scripts are valid yaml files parsed as string assert.equal(typeof(config), 'object', 'CONFIG: it doesn\'t look like a valid config file'); - assert(self.storage, 'CONFIG: storage path not defined'); - - // sanity check for strategic config properties + // sanity check for strategic config properties strategicConfigProps.forEach(function(x) { if (self[x] == null) self[x] = {}; assert(Utils.isObject(self[x]), `CONFIG: bad "${x}" value (object expected)`); diff --git a/src/lib/local-storage.js b/src/lib/local-storage.js index 571bf6164..5fec0d698 100644 --- a/src/lib/local-storage.js +++ b/src/lib/local-storage.js @@ -842,6 +842,7 @@ class LocalStorage implements IStorage { const Storage = this._loadStorePlugin(); if (_.isNil(Storage)) { + assert(this.config.storage, 'CONFIG: storage path not defined'); return new LocalDatabase(this.config, logger); } else { return Storage;