fix: is_address, is_private_key: check that text is not empty
authorThomasV <thomasv@gitorious>
Mon, 5 May 2014 08:03:31 +0000 (10:03 +0200)
committerThomasV <thomasv@gitorious>
Mon, 5 May 2014 08:03:31 +0000 (10:03 +0200)
lib/wallet.py

index e124cf0..9e354b2 100644 (file)
@@ -1667,6 +1667,8 @@ class Wallet(object):
 
     @classmethod
     def is_address(self, text):
+        if not text:
+            return False
         for x in text.split():
             if not bitcoin.is_address(x):
                 return False
@@ -1674,6 +1676,8 @@ class Wallet(object):
 
     @classmethod
     def is_private_key(self, text):
+        if not text:
+            return False
         for x in text.split():
             if not bitcoin.is_private_key(x):
                 return False