From 5d99b61d53ea9a5cf0bbeb5c7a2fd8377300100d Mon Sep 17 00:00:00 2001 From: Roman Kalyakin Date: Sat, 28 Sep 2024 12:15:08 +0200 Subject: [PATCH] fixed undefined access --- src/components/modules/lists/ItemLabel.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/modules/lists/ItemLabel.vue b/src/components/modules/lists/ItemLabel.vue index 4080bbd8..4a75b083 100644 --- a/src/components/modules/lists/ItemLabel.vue +++ b/src/components/modules/lists/ItemLabel.vue @@ -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 [ ` ${this.$n(this.item.countArticles)} articles,`, `${this.$n(this.item.countPages)} pages,`,