handle case where primary user doesn't exist when getting exp time
This commit is contained in:
parent
49153db63b
commit
438d47f634
|
@ -484,6 +484,9 @@ Key.prototype.getExpirationTime = async function(capabilities, keyId, userId) {
|
|||
}
|
||||
if (this.keyPacket.version >= 4) {
|
||||
const primaryUser = await this.getPrimaryUser(null);
|
||||
if (!primaryUser) {
|
||||
throw new Error('Could not find primary user');
|
||||
}
|
||||
const selfCert = primaryUser.selfCertification;
|
||||
const keyExpiry = getExpirationTime(this.keyPacket, selfCert);
|
||||
const sigExpiry = selfCert.getExpirationTime();
|
||||
|
|
Loading…
Reference in New Issue
Block a user