Skip to content

Commit

Permalink
fixed undefined access (#1309)
Browse files Browse the repository at this point in the history
  • Loading branch information
theorm authored Sep 28, 2024
1 parent b956ac1 commit de941c0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/modules/lists/ItemLabel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ export default {
},
newspaperDetailedLabel() {
const firstIssueDate =
this.item.firstIssue?.date instanceof Date
? this.$d(this.item.firstIssue.date, 'short')
: this.$d(new Date(this.item.firstIssue.date), 'short')
this.item?.firstIssue?.date instanceof Date
? this.$d(this.item?.firstIssue?.date ?? 0, 'short')
: this.$d(new Date(this.item?.firstIssue?.date ?? 0), 'short')
const lastIssueDate =
this.item.lastIssue?.date instanceof Date
? this.$d(this.item.lastIssue.date, 'short')
: this.$d(new Date(this.item.lastIssue.date), 'short')
this.item?.lastIssue?.date instanceof Date
? this.$d(this.item?.lastIssue?.date ?? 0, 'short')
: this.$d(new Date(this.item?.lastIssue?.date ?? 0), 'short')
return [
`<span class="number"> ${this.$n(this.item.countArticles)}</span> articles,`,
`<span class="number">${this.$n(this.item.countPages)}</span> pages,`,
Expand Down

0 comments on commit de941c0

Please sign in to comment.