fix(android/engine): More cleanup from review comments

This commit is contained in:
Darcy Wong 2020-11-27 12:33:40 +07:00
parent 73879bd64e
commit e067e836fb

View file

@ -298,13 +298,15 @@ public class PackageProcessor {
for (int f = 0; f < files.length(); f++) {
JSONObject file = files.getJSONObject(f);
String filename = file.getString(PP_FILES_NAME_KEY);
if (FileUtils.hasJavaScriptExtension(filename) && filename.equals(expectedKeyboardFilename)) {
if (filename != null && filename.equals(expectedKeyboardFilename)) {
count++;
break;
}
}
}
} catch (JSONException e) {
// Setting count to 0 due to invalid package
count = 0;
KMLog.LogException(TAG, "", e);
}