Skip to content

Commit

Permalink
Merge pull request #1593 from alliance-genome/SCRUM-4227
Browse files Browse the repository at this point in the history
SCRUM-4227 Fix null error on file history dropdown for files with no history
  • Loading branch information
markquintontulloch authored Jul 3, 2024
2 parents 6526b05 + 9b2985f commit ab79a94
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,14 @@ export const DataLoadsComponent = () => {
};

const historyTable = (file) => {
let sortedHistory = file.history.sort(function (a, b) {
const start1 = new Date(a.loadStarted);
const start2 = new Date(b.loadStarted);
return start2 - start1;
});
let sortedHistory = [];
if (file.history != null) {
sortedHistory = file.history.sort(function (a, b) {
const start1 = new Date(a.loadStarted);
const start2 = new Date(b.loadStarted);
return start2 - start1;
});
}
return (
<div className="card">
<DataTable key="historyTable" value={sortedHistory} responsiveLayout="scroll">
Expand Down

0 comments on commit ab79a94

Please sign in to comment.