Skip to content

Commit

Permalink
Merge pull request #8 from flerda/v2.0.1-merge
Browse files Browse the repository at this point in the history
fix for bug 3640075
  • Loading branch information
flerda committed Jan 5, 2013
2 parents 35f1c1f + af49852 commit 1faa505
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/com/ichi2/libanki/sync/RemoteMediaServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import com.ichi2.anki.AnkiDroidApp;
import com.ichi2.async.Connection;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
Expand Down Expand Up @@ -101,10 +103,11 @@ public long addFiles(File zip) {
if (ret == null) {
return 0;
}
StatusLine sl = ret.getStatusLine();
HttpEntity ent = ret.getEntity();
String s = "";
int resultType = ret.getStatusLine().getStatusCode();
if (resultType == 200) {
s = super.stream2String(ret.getEntity().getContent());
if (sl != null && sl.getStatusCode() == 200 && ent != null) {
s = super.stream2String(ent.getContent());
if (s != null && !s.equalsIgnoreCase("null") && s.length() != 0) {
return Long.getLong(s);
}
Expand Down

0 comments on commit 1faa505

Please sign in to comment.