Skip to content

Commit

Permalink
Account for potentially invalid images
Browse files Browse the repository at this point in the history
  • Loading branch information
AWare committed Jul 31, 2019
1 parent a67313e commit 40fda21
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion projects/backend/fronts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
PublishedFront,
} from './fronts/issue'
import { getCrosswordArticleOverrides } from './utils/crossword'
import { notNull } from '../common/src'

export const parseCollection = async (
collectionResponse: PublishedCollection,
Expand Down Expand Up @@ -71,7 +72,10 @@ export const parseCollection = async (
const mediaType = furniture.mediaType // TODO// TODO
const slideshowImages =
furniture.slideshowImages &&
furniture.slideshowImages.map(_ => _.src).map(getImageFromURL)
furniture.slideshowImages
.map(_ => _.src)
.map(getImageFromURL)
.filter(notNull)

const imageOverride =
furniture &&
Expand Down

0 comments on commit 40fda21

Please sign in to comment.