From 84fad5e827c672ee08ba34f83cfebc24446d9693 Mon Sep 17 00:00:00 2001 From: titusfortner Date: Wed, 22 Sep 2021 14:00:19 -0500 Subject: [PATCH] fix bug preventing setting a timeout because the capability response is null --- .../selenium/remote/AbstractDriverOptions.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/java/src/org/openqa/selenium/remote/AbstractDriverOptions.java b/java/src/org/openqa/selenium/remote/AbstractDriverOptions.java index 9eb71c8ce2b8d..b0a5f6ba12a35 100644 --- a/java/src/org/openqa/selenium/remote/AbstractDriverOptions.java +++ b/java/src/org/openqa/selenium/remote/AbstractDriverOptions.java @@ -139,11 +139,13 @@ public Map asMap() { private Map getTimeouts() { Map 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; } }