Skip to content

Commit

Permalink
fix: images can be undefined (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaikoTan authored Nov 15, 2023
1 parent e0b50c0 commit bbf7997
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ export function apply(ctx: Context, config: Config) {
count: options.count,
labels: options.label?.split(',')?.map((x) => x.trim())?.filter(Boolean) ?? [],
})
const source = images.source
const source = images?.source

const filtered = images.filter((image) => config.nsfw || !image.nsfw)
const filtered = images?.filter((image) => config.nsfw || !image.nsfw)

if (!filtered?.length) return session?.text('.no-result')

Expand Down

0 comments on commit bbf7997

Please sign in to comment.