From 449e510f861f56ed673613d8102f6b1a3e680ced Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 24 Jul 2020 17:00:38 -0300 Subject: [PATCH] Check for process before accessing --- lib/default-encoding.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default-encoding.js b/lib/default-encoding.js index 4404fd2..3042099 100644 --- a/lib/default-encoding.js +++ b/lib/default-encoding.js @@ -1,8 +1,8 @@ var defaultEncoding /* istanbul ignore next */ -if (process.browser) { +if (global.process && global.process.browser) { defaultEncoding = 'utf-8' -} else if (process.version) { +} else if (global.process && global.process.version) { var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10) defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'