fix error getting trading results if a user has never traded before on his polo account

This commit is contained in:
elroy 2017-07-05 10:35:56 +02:00
parent b142eff8e0
commit 8ddab27903
1 changed files with 3 additions and 0 deletions

View File

@ -98,6 +98,9 @@ public class GunbotProxyController {
} }
String result = gunbotProxyService.getTradeHistory(market); String result = gunbotProxyService.getTradeHistory(market);
if (result.equals("[]")){
return result;
}
JsonElement jelement = new JsonParser().parse(result); JsonElement jelement = new JsonParser().parse(result);
JsonObject jobject = jelement.getAsJsonObject(); JsonObject jobject = jelement.getAsJsonObject();
JsonArray jarray = jobject.getAsJsonArray(currencyPair); JsonArray jarray = jobject.getAsJsonArray(currencyPair);