Merge pull request #288 from ZortacDev/patch-1

Fix #287.
This commit is contained in:
Yishi Lin 2019-07-18 22:56:26 +08:00 committed by GitHub
commit bbc1b8124d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,11 @@ type Key struct {
}
func (k *Key) GetKeyID() string {
return k.kr.FirstKeyID
if len(k.kr.GetEntities()) > 0 {
return k.kr.GetEntities()[0].PrimaryKey.KeyIdShortString()
} else {
return ""
}
}
func (k *Key) Encrypt(plaintext []byte, armor bool) []byte {