From ae336f19cdaa799d347ac2ed77279ae9bbf6b6c1 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Thu, 18 Aug 2022 08:33:11 +0200 Subject: [PATCH] Protected against missing NODE_ENV variable - in the event NODE_ENV isn't set, this would throw an error because `startsWith` is a function call on `undefined` --- ghost/security/lib/password.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/security/lib/password.js b/ghost/security/lib/password.js index cb0a0e308a..0bf906481a 100644 --- a/ghost/security/lib/password.js +++ b/ghost/security/lib/password.js @@ -2,7 +2,7 @@ const bcrypt = require('bcryptjs'); let HASH_ROUNDS = 10; -if (process.env.NODE_ENV.startsWith('testing')) { +if (process.env.NODE_ENV?.startsWith('testing')) { HASH_ROUNDS = 1; }