Skip to content

Commit

Permalink
Fixed NPE when sorting the all time high column
Browse files Browse the repository at this point in the history
Issue: #4225
  • Loading branch information
buchen committed Sep 23, 2024
1 parent 864f13f commit 757c3c1
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ public DistanceFromAllTimeHighColumn(Supplier<LocalDate> dateProvider, List<Repo
this.setSorter(ColumnViewerSorter.create((o1, o2) -> {
ReportingPeriod option = (ReportingPeriod) ColumnViewerSorter.SortingContext.getColumnOption();

Double v1 = valueProvider.apply(o1, option).getDistance();
Double v2 = valueProvider.apply(o2, option).getDistance();
var ath1 = valueProvider.apply(o1, option);
Double v1 = ath1 == null ? null : ath1.getDistance();
var ath2 = valueProvider.apply(o2, option);
Double v2 = ath2 == null ? null : ath2.getDistance();

if (v1 == null && v2 == null)
return 0;
Expand Down

0 comments on commit 757c3c1

Please sign in to comment.