Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 6a0298e

Browse files
committed
fix bug
1 parent 9dcef06 commit 6a0298e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import java.security.spec.X509EncodedKeySpec;
2828
import java.util.ArrayList;
2929
import java.util.Collections;
30+
import java.util.LinkedList;
31+
import java.util.List;
3032
import java.util.Map;
3133

3234
import name.fraser.neil.plaintext.diff_match_patch;
@@ -118,8 +120,13 @@ public static void copyNecessaryFilesFromCurrentPackage(String diffManifestFileP
118120
public static void diffPatchApplyNecessaryFilesFromCurrentPackage(String diffManifestFilePath, String currentPackageFolderPath, String unzippedFolderPath) throws IOException {
119121
diff_match_patch dmp = new diff_match_patch();
120122
JSONObject diffManifest = CodePushUtils.getJsonObjectFromFile(diffManifestFilePath);
123+
JSONArray patchedFiles = new JSONArray();
124+
try {
125+
patchedFiles = diffManifest.getJSONArray("patchedFiles");
126+
} catch (JSONException ignored) {
127+
128+
}
121129
try {
122-
JSONArray patchedFiles = diffManifest.getJSONArray("patchedFiles");
123130
for (int i = 0; i < patchedFiles.length(); i++) {
124131
String fileNameToPatch = patchedFiles.getString(i);
125132
File fileToPatch = new File(currentPackageFolderPath, fileNameToPatch);
@@ -286,4 +293,4 @@ public static void verifyUpdateSignature(String folderPath, String packageHash,
286293

287294
CodePushUtils.log("The update contents succeeded the code signing check.");
288295
}
289-
}
296+
}

0 commit comments

Comments
 (0)