mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-03-11 19:24:48 +00:00
handle case where primary user doesn't exist when getting exp time
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user