Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Fix hasInputStreamBody method to iterate uppon correct keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Oliveira committed Apr 22, 2015
1 parent ac628e4 commit 7a33b7e
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,19 @@ public AsyncTask upload(JSONObject command) throws Exception {
protected boolean hasInputStreamBody(JSONObject command)
throws JSONException {

Iterator<String> keys = command.keys();
if (command.length() == 0) {
return false;
}

String first = command.names().getString(0);
JSONObject params = command.getJSONObject(first);

Iterator<String> keys = params.keys();

while (keys.hasNext()) {
String key = keys.next();

if (command.get(key) instanceof InputStreamBody) {
if (params.get(key) instanceof InputStreamBody) {
return true;
}
}
Expand Down

0 comments on commit 7a33b7e

Please sign in to comment.