From da89d67b250cfac43d31617776d44912141c7006 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 21 Jul 2021 14:24:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E7=BC=BA=E9=99=B7=E7=BB=9F=E8=AE=A1=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/track/service/TestPlanService.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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);