Skip to content

Commit

Permalink
fix(API): handle undefined response data
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeaturner committed Sep 12, 2024
1 parent cafbcd6 commit 9b3b83d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions API/reuse.js
Original file line number Diff line number Diff line change
Expand Up @@ -869,13 +869,13 @@ async function getAPI(page, getContents, username = undefined) {
else {
properties = [];
}
if (tags.tag) {
if (tags && tags.tag) {
tags = tags.tag.length ? tags.tag : [tags.tag];
}
else {
tags = []
}
if (files.file) {
if (files && files.file) {
files = files.file.length ? files.file : [files.file];
files = files.map((file) => {
return {
Expand Down

0 comments on commit 9b3b83d

Please sign in to comment.