From b4876706fef7e42c4cd89811c6238c57b8d2020a Mon Sep 17 00:00:00 2001 From: bill bittner Date: Wed, 18 Oct 2017 10:00:24 -0700 Subject: [PATCH] removed !result catches --- controllers/serveController.js | 7 ++----- models/index.js | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/controllers/serveController.js b/controllers/serveController.js index 07825684..50403a16 100644 --- a/controllers/serveController.js +++ b/controllers/serveController.js @@ -112,7 +112,7 @@ module.exports = { return new Promise((resolve, reject) => { db.getLongClaimId(claimName, claimId) // 1. get the long claim id .then(result => { // 2. get the asset using the long claim id - if (result === NO_CLAIM || !result) { + if (result === NO_CLAIM) { resolve(NO_CLAIM); return; } @@ -129,7 +129,7 @@ module.exports = { return new Promise((resolve, reject) => { db.getLongChannelId(channelName, channelId) // 1. get the long channel id .then(result => { // 2. get the long claim Id - if (result === NO_CHANNEL || !result) { + if (result === NO_CHANNEL) { resolve(NO_CHANNEL); return; } @@ -140,9 +140,6 @@ module.exports = { if (result === NO_CHANNEL || result === NO_CLAIM) { resolve(result); return; - } else if (!result) { - resolve(NO_CLAIM); - return; } resolve(getAssetByLongClaimId(result, claimName)); }) diff --git a/models/index.js b/models/index.js index ac152c70..192cece9 100644 --- a/models/index.js +++ b/models/index.js @@ -73,7 +73,7 @@ function getTopFreeClaimIdByClaimName (name) { .then(result => { switch (result.length) { case 0: - return resolve(null); + return resolve(NO_CLAIM); default: return resolve(result[0].claimId); }