From 399a87eaaf177e41e2de3d20884ccf6addc06e02 Mon Sep 17 00:00:00 2001 From: Steffen Butzer Date: Fri, 10 Feb 2023 20:27:31 +0100 Subject: [PATCH] Fix sorting of images w/o date. E.g. OCI build-cache doesnt have a created date available, which leads to an error due to creationDate being undefined. --- src/components/tag-list/tag-table.riot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/tag-list/tag-table.riot b/src/components/tag-list/tag-table.riot index f10362a..722092f 100644 --- a/src/components/tag-list/tag-table.riot +++ b/src/components/tag-list/tag-table.riot @@ -265,8 +265,8 @@ along with this program. If not, see . if (this.state.orderType === 'date') { sortedTags.sort((e1, e2) => !this.state.desc - ? e2.creationDate.getTime() - e1.creationDate.getTime() - : e1.creationDate.getTime() - e2.creationDate.getTime() + ? (e2.creationDate?.getTime()||0) - (e1.creationDate?.getTime()||0) + : (e1.creationDate?.getTime()||0) - (e2.creationDate?.getTime()||0) ); } else if (this.state.orderType === 'size') { sortedTags.sort((e1, e2) => (!this.state.desc ? e2.size - e1.size : e1.size - e2.size));