Merge "Fixing crash when using app name comparator with empty titles." into ub-launcher3-burnaby
This commit is contained in:
commit
051527fd54
|
@ -85,8 +85,10 @@ public class AppNameComparator {
|
|||
*/
|
||||
@Thunk int compareTitles(String titleA, String titleB) {
|
||||
// Ensure that we de-prioritize any titles that don't start with a linguistic letter or digit
|
||||
boolean aStartsWithLetter = Character.isLetterOrDigit(titleA.codePointAt(0));
|
||||
boolean bStartsWithLetter = Character.isLetterOrDigit(titleB.codePointAt(0));
|
||||
boolean aStartsWithLetter = (titleA.length() > 0) &&
|
||||
Character.isLetterOrDigit(titleA.codePointAt(0));
|
||||
boolean bStartsWithLetter = (titleB.length() > 0) &&
|
||||
Character.isLetterOrDigit(titleB.codePointAt(0));
|
||||
if (aStartsWithLetter && !bStartsWithLetter) {
|
||||
return -1;
|
||||
} else if (!aStartsWithLetter && bStartsWithLetter) {
|
||||
|
|
Loading…
Reference in New Issue