Skip to content

Commit 8082867

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

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎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)