Skip to content

Commit

Permalink
fix: サムネイル画像がない場合にエラーになっていたのを修正 (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnao305 authored Oct 15, 2023
1 parent 629f59e commit ac3a0a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/content/modules/postPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const downloadEverythingFromPost = async (): Promise<void> => {

const baseFilepath = `${idAndTitlePath(data.fanclub.id, data.fanclub.fanclub_name_with_creator_name)}/${idAndTitlePath(data.id, data.title)}`

if (data.thumb.original) {
if (data.thumb?.original) {
// サムネイル画像がある場合
const ext = data.thumb.original.split('.').at(-1)
fileDownload(data.thumb.original, baseFilepath, `thumbnail.${ext}`)
Expand Down
2 changes: 1 addition & 1 deletion src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export interface PostData {
'title': string
'comment': string | null
'rating': string
'thumb': {
'thumb'?: {
thumb: string
medium: string
large: string
Expand Down

0 comments on commit ac3a0a3

Please sign in to comment.