- Only sort custom drafts if there is something to sort.

This commit is contained in:
Agetian
2017-07-11 17:08:29 +00:00
parent df56df5ede
commit 1a076a648a

View File

@@ -148,16 +148,16 @@ public class BoosterDraft implements IBoosterDraft {
case Custom:
final List<CustomLimited> myDrafts = loadCustomDrafts();
myDrafts.sort(new Comparator<CustomLimited>() {
@Override
public int compare(CustomLimited o1, CustomLimited o2) {
return o1.getName().compareTo(o2.getName());
}
});
if (myDrafts.isEmpty()) {
SOptionPane.showMessageDialog("No custom draft files found.");
} else {
myDrafts.sort(new Comparator<CustomLimited>() {
@Override
public int compare(CustomLimited o1, CustomLimited o2) {
return o1.getName().compareTo(o2.getName());
}
});
final CustomLimited customDraft = SGuiChoose.oneOrNone("Choose Custom Draft", myDrafts);
if (customDraft == null) {
return false;