Skip to content

Commit 1a6bc2c

Browse files
committed
check for bsConfig.run_settings.cypressProjectDir existance
1 parent c6fea0c commit 1a6bc2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/helpers/usageReporting.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function local_cypress_version(bsConfig) {
3333
// 1. check version of Cypress installed in local project
3434
// 2. check version of Cypress installed globally if not present in project
3535

36-
if (bsConfig) {
36+
if (bsConfig && bsConfig.run_settings.cypressProjectDir) {
3737
let version = get_version(path.join(bsConfig.run_settings.cypressProjectDir, 'node_modules', '.bin', 'cypress'));
3838
if (!version) {
3939
version = get_version('cypress');
@@ -80,7 +80,7 @@ function cli_version_and_path(bsConfig) {
8080
// 1. check version of Cypress installed in local project
8181
// 2. check version of Cypress installed globally if not present in project
8282

83-
if (bsConfig) {
83+
if (bsConfig && bsConfig.run_settings.cypressProjectDir) {
8484
let _path = path.join(bsConfig.run_settings.cypressProjectDir, 'node_modules', 'browserstack-cypress');
8585
let version = get_version(_path);
8686
if (!version) {

0 commit comments

Comments
 (0)