Skip to content

Commit

Permalink
fix(twoChannel): correct handle undefined files array at fetchFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
d0kur0 committed Sep 21, 2023
1 parent 012dc37 commit 0fb5f90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vendors/twoChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const twoChannelFactory: VendorImplementation = props => {

const response: ThreadResponse = await fetch(requestUrl).then(r => r.json());
const rawFiles = response.threads?.[0].posts
.map(({ files, date }) => files.map(file => ({ ...file, date })))
.map(({ files, date }) => files?.map(file => ({ ...file, date })) || [])
.flat();

const files = rawFiles.map<File>(rawFile => ({
Expand Down

0 comments on commit 0fb5f90

Please sign in to comment.