diff --git a/storage/StorageManager.js b/storage/StorageManager.js index d4b5714..6448f55 100644 --- a/storage/StorageManager.js +++ b/storage/StorageManager.js @@ -41,6 +41,9 @@ class StorageManager { // Transaction ID concept //`${shard.id}-${new Date().getTime().toString(36)}` + //NULL RESPONSE IF COLLECTION DOES NOT EXIST!! + //EMPTY OBJECT IF NOTHING MATCHED!! + /** Message structure * { * provider: string, -- mongodb or mariadb @@ -60,7 +63,7 @@ class StorageManager { const response = await this.providers.get(message.provider)._query(message.request); - if(response.error) { + if(response && response.error) { this.manager.logger.write('error', `Provider ${message.provider} errored: ${response.message}`, shard); return this._send(shard, response.error); }