diff options
Diffstat (limited to 'database.go')
-rw-r--r-- | database.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/database.go b/database.go index edab4f6..954ec0f 100644 --- a/database.go +++ b/database.go @@ -31,7 +31,7 @@ func GetActorFromDB(db *sql.DB, id string) Actor { } nActor.PublicKey = GetActorPemFromDB(db, publicKeyPem) - if nActor.PublicKey.PublicKeyPem == ""{ + if nActor.Id != "" && nActor.PublicKey.PublicKeyPem == ""{ err = CreatePublicKeyFromPrivate(db, &nActor, publicKeyPem) CheckError(err, "error creating public key from private") } @@ -57,8 +57,7 @@ func GetActorByNameFromDB(db *sql.DB, name string) Actor { CheckError(err, "error with actor from db scan ") } - nActor.PublicKey = GetActorPemFromDB(db, publicKeyPem) - if nActor.PublicKey.PublicKeyPem == ""{ + if nActor.Id != "" && nActor.PublicKey.PublicKeyPem == ""{ err = CreatePublicKeyFromPrivate(db, &nActor, publicKeyPem) CheckError(err, "error creating public key from private") } |