Skip to content

Commit

Permalink
Return empty array for error conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoet-jh committed Sep 4, 2024
1 parent 0b0cf4d commit 140aba9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/services/oa-manuscript-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand All @@ -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();
})
Expand Down

0 comments on commit 140aba9

Please sign in to comment.