Merge pull request #1921 from waku-org/bug/check-process

fix: check if process is defined before accessing it
This commit is contained in:
Arseniy Klempner 2024-03-16 19:45:42 -07:00 committed by GitHub
commit 40c5e0ec30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ export async function defaultLibp2p(
options?: Partial<CreateLibp2pOptions>,
userAgent?: string
): Promise<Libp2p> {
if (!options?.hideWebSocketInfo && process.env.NODE_ENV !== "test") {
if (!options?.hideWebSocketInfo && process?.env?.NODE_ENV !== "test") {
/* eslint-disable no-console */
console.info(
"%cIgnore WebSocket connection failures",