commit d950cd7323b2b430a8a0443737092bf2d48f9f0a
parent e64f63043380b323e8deff80675231a6b4f3e184
Author: ThomasV <thomasv@electrum.org>
Date: Fri, 14 Oct 2016 06:38:49 +0200
fix crash when parsing request (issue #1969)
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/paymentrequest.py b/lib/paymentrequest.py
@@ -117,7 +117,11 @@ class PaymentRequest:
self.error = "Empty request"
return
pr = pb2.PaymentRequest()
- pr.ParseFromString(self.raw)
+ try:
+ pr.ParseFromString(self.raw)
+ except:
+ self.error = "Error: Cannot parse payment request"
+ return
if not pr.signature:
# the address will be dispayed as requestor
self.requestor = None