File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
javascript/node/selenium-webdriver/common Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -89,14 +89,20 @@ function driverLocation(options) {
89
89
args . push ( '--browser-path' , '"' + vendorOptions . binary + '"' )
90
90
}
91
91
92
- // Get the httpProxy and sslProxy values from the options object
93
- const httpProxy = options . getProxy ( ) [ 'httpProxy' ] ;
94
- const sslProxy = options . getProxy ( ) [ 'sslProxy' ] ;
95
-
96
- if ( httpProxy ) {
97
- args . push ( '--proxy' , httpProxy ) ;
98
- } else if ( sslProxy ) {
99
- args . push ( '--proxy' , sslProxy ) ;
92
+ const proxyOptions = options . getProxy ( ) ;
93
+
94
+ // Check if proxyOptions exists and has properties
95
+ if ( proxyOptions && Object . keys ( proxyOptions ) . length > 0 ) {
96
+ const httpProxy = proxyOptions [ 'httpProxy' ] ;
97
+ const sslProxy = proxyOptions [ 'sslProxy' ] ;
98
+
99
+ if ( httpProxy !== undefined ) {
100
+ args . push ( '--proxy' , httpProxy ) ;
101
+ }
102
+
103
+ else if ( sslProxy !== undefined ) {
104
+ args . push ( '--proxy' , sslProxy ) ;
105
+ }
100
106
}
101
107
102
108
const smBinary = getBinary ( )
You can’t perform that action at this time.
0 commit comments