From c963facc8c1a0f3cb853d29986a2bb055e87aa73 Mon Sep 17 00:00:00 2001 From: xiphon Date: Wed, 16 Jan 2019 17:49:14 +0000 Subject: [PATCH] WalletManager: fix handling Payment URLs with empty amount --- src/libwalletqt/WalletManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libwalletqt/WalletManager.cpp b/src/libwalletqt/WalletManager.cpp index f5f0121f..6ac7e179 100644 --- a/src/libwalletqt/WalletManager.cpp +++ b/src/libwalletqt/WalletManager.cpp @@ -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 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 {