At least it doesn't crash

This commit is contained in:
Nicolás Sánchez 2024-12-16 20:15:57 -03:00
parent 54c2247b6f
commit e50cfa808b
1 changed files with 11 additions and 2 deletions

View File

@ -447,10 +447,18 @@ public class InstanceInterface {
String dealOrderHistory = value.has("deal_order_history") && value.get("deal_order_history").isJsonPrimitive() ? value.get("deal_order_history").getAsString() : null; String dealOrderHistory = value.has("deal_order_history") && value.get("deal_order_history").isJsonPrimitive() ? value.get("deal_order_history").getAsString() : null;
String pauseReason = value.has("pause_reason") && value.get("pause_reason").isJsonPrimitive() ? value.get("pause_reason").getAsString() : null; String pauseReason = value.has("pause_reason") && value.get("pause_reason").isJsonPrimitive() ? value.get("pause_reason").getAsString() : null;
String statusString = value.has("status_string") && value.get("status_string").isJsonPrimitive() ? value.get("status_string").getAsString() : null; String statusString = value.has("status_string") && value.get("status_string").isJsonPrimitive() ? value.get("status_string").getAsString() : null;
JsonObject oldLong = null; JsonObject oldLong;
OldLongDictionary oldLongDictionary = null;
if (value.has("old_long")) { if (value.has("old_long")) {
oldLong = value.get("old_long").getAsJsonObject(); oldLong = value.get("old_long").getAsJsonObject();
//translate from json to OldLongDictionary //translate from json to OldLongDictionary
oldLongDictionary = new OldLongDictionary(
oldLong.get("datetime").getAsString(),
oldLong.get("fees_paid_in_quote").getAsDouble(),
oldLong.get("quote_spent").getAsDouble(),
oldLong.get("tp_amount").getAsDouble(),
oldLong.get("tp_price").getAsDouble()
);
} }
valueToReturn.add(new WorkerStatsData( valueToReturn.add(new WorkerStatsData(
@ -482,7 +490,7 @@ public class InstanceInterface {
safetyPriceTable, safetyPriceTable,
dealOrderHistory, dealOrderHistory,
pauseReason, pauseReason,
oldLong, oldLongDictionary,
statusString statusString
)); ));
} catch (Exception e) { } catch (Exception e) {
@ -621,6 +629,7 @@ public class InstanceInterface {
workerStatsData.getPrice(), workerStatsData.getPrice(),
workerStatsData.getTakeProfitPrice(), workerStatsData.getTakeProfitPrice(),
workerStatsData.getIsShort(), workerStatsData.getIsShort(),
//Let's deal with this later
false, false,
false, false,
false, false,