File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
java/src/org/openqa/selenium/firefox Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -305,7 +305,8 @@ public FirefoxOptions merge(Capabilities capabilities) {
305305 List <String > arguments = (List <String >) (capabilities .getCapability (("args" )));
306306 arguments .forEach (
307307 arg -> {
308- if (!((List <String >) newInstance .firefoxOptions .get (Keys .ARGS .key ())).contains (arg )) {
308+ List <String > existingArgs = (List <String >) newInstance .firefoxOptions .get (Keys .ARGS .key ());
309+ if (existingArgs == null || !existingArgs .contains (arg )) {
309310 newInstance .addArguments (arg );
310311 }
311312 });
@@ -367,7 +368,8 @@ public FirefoxOptions merge(Capabilities capabilities) {
367368
368369 arguments .forEach (
369370 arg -> {
370- if (!((List <String >) newInstance .firefoxOptions .get (Keys .ARGS .key ())).contains (arg )) {
371+ List <String > existingArgs = (List <String >) newInstance .firefoxOptions .get (Keys .ARGS .key ());
372+ if (existingArgs == null || !existingArgs .contains (arg )) {
371373 newInstance .addArguments (arg );
372374 }
373375 });
You can’t perform that action at this time.
0 commit comments