aboutsummaryrefslogtreecommitdiff
path: root/src/qt/guiutil.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2011-08-07 16:16:49 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2011-08-07 16:17:02 +0200
commitc359ac9128b9b1a6fda29a2a49da0991f835ad0e (patch)
treea891df686f7dcd449ee7cb35d48b6e281396bf89 /src/qt/guiutil.cpp
parent856aacf388b2dd4c8213e699ff6377203a9194cc (diff)
allow empty/missing amounts in URL
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r--src/qt/guiutil.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 3516d4f83a..6329d51d01 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -53,9 +53,18 @@ bool GUIUtil::parseBitcoinURL(const QUrl *url, SendCoinsRecipient *out)
SendCoinsRecipient rv;
rv.address = url->path();
rv.label = url->queryItemValue("label");
- if(!BitcoinUnits::parse(BitcoinUnits::BTC, url->queryItemValue("amount"), &rv.amount))
+
+ QString amount = url->queryItemValue("amount");
+ if(amount.isEmpty())
{
- return false;
+ rv.amount = 0;
+ }
+ else // Amount is non-empty
+ {
+ if(!BitcoinUnits::parse(BitcoinUnits::BTC, amount, &rv.amount))
+ {
+ return false;
+ }
}
if(out)
{