fix crash in ComposeActivity when loading no Emojis

main
Conny Duck 6 years ago
parent 925e82e035
commit d58041773a
  1. 3
      app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java

@ -313,6 +313,9 @@ public final class ComposeActivity
@Override @Override
public void onResponse(@NonNull Call<List<Emoji>> call, @NonNull Response<List<Emoji>> response) { public void onResponse(@NonNull Call<List<Emoji>> call, @NonNull Response<List<Emoji>> response) {
emojiList = response.body(); emojiList = response.body();
if(emojiList == null) {
emojiList = Collections.emptyList();
}
Collections.sort(emojiList, (a, b) -> a.getShortcode().toLowerCase().compareTo(b.getShortcode().toLowerCase())); Collections.sort(emojiList, (a, b) -> a.getShortcode().toLowerCase().compareTo(b.getShortcode().toLowerCase()));
setEmojiList(emojiList); setEmojiList(emojiList);
cacheInstanceMetadata(activeAccount); cacheInstanceMetadata(activeAccount);

Loading…
Cancel
Save