From 140aba9c44a26c53ebe06365464698022ab099bc Mon Sep 17 00:00:00 2001 From: Russ Poetker Date: Wed, 4 Sep 2024 16:29:09 -0400 Subject: [PATCH] Return empty array for error conditions --- app/services/oa-manuscript-service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/oa-manuscript-service.js b/app/services/oa-manuscript-service.js index c8228262..1a935162 100644 --- a/app/services/oa-manuscript-service.js +++ b/app/services/oa-manuscript-service.js @@ -23,7 +23,7 @@ export default class OAManuscriptService extends Service { console.assert(!!doi, '%cNo DOI was provided to the manuscript service lookup.', 'color: red;'); if (!this.lookUpPath || !doi) { - return; + return []; } const url = `${this.lookUpPath}?doi=${doi}`; @@ -38,7 +38,7 @@ export default class OAManuscriptService extends Service { .then((resp) => { if (resp.status !== 200) { console.log(`%cFailed to lookup files for DOI (${doi}). Reason: "${resp.message}"`, 'color: red;'); - return {}; + return []; } return resp.json(); })