Skip to content

Commit

Permalink
Merge pull request #25 from HuobiRDCenter/FEATURE_1_0_12
Browse files Browse the repository at this point in the history
fix changetime
  • Loading branch information
huobiapi authored Apr 3, 2020
2 parents 2e27019 + 3b02be2 commit cda5dd8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define CURRENT_VERSION 1.0.11
#define CURRENT_VERSION 1.0.12
6 changes: 6 additions & 0 deletions src/Utils/JsonWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ namespace Huobi {

const char* JsonWrapper::getString(const char* name) const {
checkMandatoryField(name);
if (object[name].GetString() == nullptr) {
return "";
}
return object[name].GetString();
}

Expand All @@ -54,6 +57,9 @@ namespace Huobi {
if (!containKey(name)) {
return def;
}
if (object[name].GetString() == nullptr) {
return def;
}
return std::stol(object[name].GetString());
}

Expand Down
2 changes: 1 addition & 1 deletion src/WebSocketApiImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ namespace Huobi {
accountUpdateEvent.available = data.getDecimal("available");
if (data.containKey("balance"))
accountUpdateEvent.balance = data.getDecimal("balance");
accountUpdateEvent.changeTime = data.getLong("changeTime");
accountUpdateEvent.changeTime=data.getLongOrDefault("changeTime", -1);
accountUpdateEvent.changeType = AccountsUpdateChangeType::lookup(data.getString("changeType"));
accountUpdateEvent.currency = data.getString("currency");
return accountUpdateEvent;
Expand Down

0 comments on commit cda5dd8

Please sign in to comment.