Merge pull request #1906

c963fac WalletManager: fix handling Payment URLs with empty amount (xiphon)
This commit is contained in:
luigi1111 2019-01-21 15:02:22 -06:00
commit ea92e411c4
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -307,7 +307,7 @@ QVariantMap WalletManager::parse_uri_to_object(const QString &uri) const
{
QString address;
QString payment_id;
uint64_t amount;
uint64_t amount = 0;
QString tx_description;
QString recipient_name;
QVector<QString> unknown_parameters;
@ -317,7 +317,7 @@ QVariantMap WalletManager::parse_uri_to_object(const QString &uri) const
if (this->parse_uri(uri, address, payment_id, amount, tx_description, recipient_name, unknown_parameters, error)) {
result.insert("address", address);
result.insert("payment_id", payment_id);
result.insert("amount", this->displayAmount(amount));
result.insert("amount", amount > 0 ? this->displayAmount(amount) : "");
result.insert("tx_description", tx_description);
result.insert("recipient_name", recipient_name);
} else {