File tree 1 file changed +4
-2
lines changed
java/client/src/org/openqa/selenium
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -68,10 +68,12 @@ public ImmutableCapabilities(
68
68
}
69
69
70
70
public ImmutableCapabilities (Capabilities other ) {
71
- this (other .asMap ());
71
+ Require .nonNull ("Capabilities" , other );
72
+ other .getCapabilityNames ().forEach (name -> delegate .setCapability (name , other .getCapability (name )));
72
73
}
73
74
74
75
public ImmutableCapabilities (Map <?, ?> capabilities ) {
76
+ Require .nonNull ("Capabilities" , capabilities );
75
77
capabilities .forEach ((key , value ) -> {
76
78
Require .argument ("Key" , key ).instanceOf (String .class );
77
79
delegate .setCapability (String .valueOf (key ), value );
@@ -118,4 +120,4 @@ public static ImmutableCapabilities copyOf(Capabilities capabilities) {
118
120
119
121
return new ImmutableCapabilities (capabilities );
120
122
}
121
- }
123
+ }
You can’t perform that action at this time.
0 commit comments