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

Commit 8082867

Browse files
authored
Fix for IllegalStateException while CodePushUpdateManager.downloadPackage (#1206)
1 parent d6cf63e commit 8082867

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ public void downloadPackage(JSONObject updatePackage, String expectedBundleFileN
163163
try {
164164
URL downloadUrl = new URL(downloadUrlString);
165165
connection = (HttpURLConnection) (downloadUrl.openConnection());
166+
bin = new BufferedInputStream(connection.getInputStream());
166167

167168
long totalBytes = connection.getContentLength();
168169
long receivedBytes = 0;
169170

170-
bin = new BufferedInputStream(connection.getInputStream());
171171
File downloadFolder = new File(getCodePushPath());
172172
downloadFolder.mkdirs();
173173
downloadFile = new File(downloadFolder, CodePushConstants.DOWNLOAD_FILE_NAME);

0 commit comments

Comments
 (0)