diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index a72ae34a60..7947ad8be3 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -840,7 +840,16 @@ public class TestPlanService { } } issues.addAll(issue); - Collections.sort(issues, Comparator.comparing(Issues::getCreateTime, (t1, t2) -> t2.compareTo(t1))); + Collections.sort(issues, + Comparator.comparing(Issues::getCreateTime, (t1, t2) -> { + if (t1 == null) { + return 1; + } else if (t2 == null) { + return -1; + } + return t2.compareTo(t1); + }) + ); } components.forEach(component -> { component.readRecord(testCase);