From 8daf600ed07e3c3ce6b35fd81c188c6959484035 Mon Sep 17 00:00:00 2001 From: Mick Ryan Date: Thu, 16 Jan 2020 14:25:24 -0800 Subject: [PATCH] fix(archive): PR Feedback --- src/lib/viewers/archive/ArchiveExplorer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/viewers/archive/ArchiveExplorer.js b/src/lib/viewers/archive/ArchiveExplorer.js index 20f9978d33..a711f38efb 100644 --- a/src/lib/viewers/archive/ArchiveExplorer.js +++ b/src/lib/viewers/archive/ArchiveExplorer.js @@ -162,15 +162,16 @@ class ArchiveExplorer extends React.Component { */ sortItemList(itemList) { const { sortBy, sortDirection } = this.state; - let sortedItems; if (!sortBy.length) { return itemList; } + let sortedItems; + try { - sortedItems = itemList.sort((a, b) => { - if (!a[sortBy] || !b[sortBy]) { + sortedItems = itemList.sort((a = {}, b = {}) => { + if (!a[sortBy] || [sortBy]) { return -1; }