Commit 42526eb1 authored by fallenstardust's avatar fallenstardust

在线备份为空时不执行比较排序

parent a6a2506e
...@@ -25,15 +25,18 @@ public class MyDeckResponse { ...@@ -25,15 +25,18 @@ public class MyDeckResponse {
public List<MyOnlineDeckDetail> getData() { public List<MyOnlineDeckDetail> getData() {
//根据deckType排序,提高观感 //根据deckType排序,提高观感
data.sort((o1, o2) -> { if (!data.isEmpty() || data != null) {
String type1 = o1.getDeckType(); data.sort((o1, o2) -> {
String type2 = o2.getDeckType(); String type1 = o1.getDeckType();
String type2 = o2.getDeckType();
if (type1 == null && type2 == null) return 0;
if (type1 == null) return 1; if (type1 == null && type2 == null) return 0;
if (type2 == null) return -1; if (type1 == null) return 1;
return type1.compareTo(type2); if (type2 == null) return -1;
}); return type1.compareTo(type2);
});
}
return data; return data;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment