Skip to content

Commit

Permalink
fixed name bug sort of
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemmmy committed Sep 30, 2016
1 parent 9fd3fc3 commit 9377ebb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/controllers/names.js
Expand Up @@ -195,6 +195,8 @@ NamesController.transferName = function(name, privatekey, address) {

NamesController.updateName = function(name, privatekey, a) {
return new Promise(function(resolve, reject) {
a = a || "";

if (!name) {
return reject(new errors.ErrorMissingParameter('name'));
}
Expand All @@ -203,15 +205,11 @@ NamesController.updateName = function(name, privatekey, a) {
return reject(new errors.ErrorMissingParameter('privatekey'));
}

if (!a) {
return reject(new errors.ErrorMissingParameter('a'));
}

if (!krist.isValidName(name)) {
return reject(new errors.ErrorInvalidParameter('name'));
}

if (!krist.isValidARecord(a)) {
if (a && !krist.isValidARecord(a)) {
return reject(new errors.ErrorInvalidParameter('a'));
}

Expand Down

0 comments on commit 9377ebb

Please sign in to comment.