Fix exception sorting conversations

Test: robotests
Fixes: 178618139
Change-Id: I524187a5840163d65dce35827785f3139b6fede7
This commit is contained in:
Julia Reynolds
2021-02-18 13:02:52 -05:00
parent aafaacfae1
commit 85511dbef8
2 changed files with 39 additions and 2 deletions

View File

@@ -163,8 +163,16 @@ public abstract class ConversationListPreferenceController extends AbstractPrefe
return o1.getNotificationChannel().getId().compareTo(
o2.getNotificationChannel().getId());
}
return sCollator.compare(o1.getShortcutInfo().getLabel(),
o2.getShortcutInfo().getLabel());
if (o1.getShortcutInfo().getLabel() == null
&& o2.getShortcutInfo().getLabel() != null) {
return 1;
}
if (o1.getShortcutInfo().getLabel() != null
&& o2.getShortcutInfo().getLabel() == null) {
return -1;
}
return sCollator.compare(o1.getShortcutInfo().getLabel().toString(),
o2.getShortcutInfo().getLabel().toString());
}
};
}