We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b41a3a commit f38cda8Copy full SHA for f38cda8
packages/bitcore-vault/src/secureProcess.ts
@@ -127,7 +127,7 @@ export class SecureProcess {
127
const err = error as Error;
128
129
// Determine if this is a fatal error
130
- const fatalActions = ['initialize', 'checkSecureHeap'];
+ const fatalActions = ['initialize', 'checkSecureHeap', 'getPublicKey'];
131
if (fatalActions.includes(action)) {
132
this.sendFatalError(err, messageId);
133
} else {
@@ -243,6 +243,9 @@ export class SecureProcess {
243
}
244
245
private getPublicKey(): string {
246
+ if (!this.publicKey) {
247
+ throw new Error('Secure process is missing public key');
248
+ }
249
return this.publicKey.export({ type: 'spki', format: 'pem' }).toString();
250
251
0 commit comments