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`
This commit is contained in:
Daniel Lockyer 2022-08-18 08:33:11 +02:00
parent 0f998e30aa
commit ae336f19cd
No known key found for this signature in database
GPG Key ID: D21186F0B47295AD

View File

@ -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;
}