fix: Fix issue with key formatting if null or undefined (#6924)

fix format private key if null or undefined
This commit is contained in:
Marcus 2023-08-14 16:41:37 +02:00 committed by GitHub
parent e83b93f293
commit 4e4a3cf7ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -223,7 +223,7 @@ export const keysToLowercase = <T>(headers: T) => {
* @returns The formatted private key.
*/
export function formatPrivateKey(privateKey: string): string {
if (/\n/.test(privateKey)) {
if (!privateKey || /\n/.test(privateKey)) {
return privateKey;
}
let formattedPrivateKey = '';