From 8fc7fd55f5f5fe64bde5d80e73ee417cff2fa316 Mon Sep 17 00:00:00 2001
From: Inso <insomniak.fr@gmail.com>
Date: Tue, 12 Jan 2016 05:01:18 +0100
Subject: [PATCH] Fix bug #338

---
 src/sakia/core/wallet.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/sakia/core/wallet.py b/src/sakia/core/wallet.py
index ae43c72e..2f9c229d 100644
--- a/src/sakia/core/wallet.py
+++ b/src/sakia/core/wallet.py
@@ -267,9 +267,12 @@ class Wallet(QObject):
 
         self.caches[community.currency]._transfers.append(transfer)
 
-        result = self.tx_inputs(int(amount), community)
-        inputs = result[0]
-        self.caches[community.currency].available_sources = result[1][1:]
+        try:
+            result = self.tx_inputs(int(amount), community)
+            inputs = result[0]
+            self.caches[community.currency].available_sources = result[1][1:]
+        except NotEnoughMoneyError as e:
+            return False, str(e)
         logging.debug("Inputs : {0}".format(inputs))
 
         outputs =  self.tx_outputs(recipient, amount, inputs)
-- 
GitLab