Catch invalid network names in IdentityFromString/LinkAccounts

This commit is contained in:
moneromooo
2015-02-07 10:01:13 +00:00
parent 3e88744e3b
commit db727c9329
2 changed files with 8 additions and 1 deletions
+5 -1
View File
@@ -163,7 +163,11 @@ def LinkAccount(link,cmd):
if linked_identity == None:
link.send('usage: !link_account [<network>:]<username>')
return
linked_identity=IdentityFromString(link,linked_identity)
try:
linked_identity=IdentityFromString(link,linked_identity)
except Exception,e:
link.send('%s is invalid' % linked_identity)
return
ok,reason=LinkCore(link,linked_identity)
if not ok:
link.send('An error occured')