fix(android/engine): Change getList() to return an empty list

This prevents the NullPointerException in CloudRepository.prepareResourcesUpdateQuery() when the list doesn't exist.
This commit is contained in:
Darcy Wong 2021-04-20 14:06:57 +07:00
parent 7bdf03e481
commit cfd8abc744

View file

@ -469,7 +469,7 @@ public final class KeyboardPickerActivity extends BaseActivity {
// Gets a raw list of installed lexical models.
@SuppressWarnings("unchecked")
private static ArrayList<HashMap<String, String>> getList(Context context, String filename) {
ArrayList<HashMap<String, String>> list = null;
ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
File file = new File(context.getDir("userdata", Context.MODE_PRIVATE), filename);
if (file.exists()) {
try {