From 9d6bd290911e4bdfe53982f4a30690adc75106e1 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 29 Jul 2024 10:58:22 -0600 Subject: [PATCH] fix: use ?. to check if keyUtils.getPrivateKey exists --- dashtx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashtx.js b/dashtx.js index 9cd7da5..921c487 100644 --- a/dashtx.js +++ b/dashtx.js @@ -250,7 +250,7 @@ var DashTx = ("object" === typeof module && exports) || {}; }; Tx.create = function (keyUtils) { - if (!keyUtils.getPrivateKey) { + if (!keyUtils?.getPrivateKey) { throw new Error(`you must create with 'opts.getPrivateKey()'`); }