Skip to content

Commit

Permalink
fix bug preventing setting a timeout because the capability response …
Browse files Browse the repository at this point in the history
…is null
  • Loading branch information
titusfortner committed Sep 22, 2021
1 parent 9976521 commit 84fad5e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions java/src/org/openqa/selenium/remote/AbstractDriverOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,13 @@ public Map<String, Object> asMap() {
private Map<String, Number> getTimeouts() {
Map<String, Number> newTimeouts = new HashMap<>();
Object raw = getCapability(TIMEOUTS);
((Map<?, ?>) raw).forEach((key, value) -> {
if (key instanceof String && value instanceof Number) {
newTimeouts.put((String) key, (Number) value);
}
});
if (raw != null) {
((Map<?, ?>) raw).forEach((key, value) -> {
if (key instanceof String && value instanceof Number) {
newTimeouts.put((String) key, (Number) value);
}
});
}
return newTimeouts;
}
}

0 comments on commit 84fad5e

Please sign in to comment.