Skip to content

Commit c8a3e88

Browse files
committed
chore: safer access on optional fields
1 parent 4fe9444 commit c8a3e88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/utilities/src/hmac.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async function ensureSubtleCryptoExists() {
5050
}
5151

5252
try {
53-
subtleCrypto = (await import('node:crypto')).webcrypto.subtle as SubtleCrypto;
53+
subtleCrypto = (await import('node:crypto'))?.webcrypto?.subtle as SubtleCrypto;
5454
} catch {
5555
// Ignore import error
5656
}

0 commit comments

Comments
 (0)