Skip to content

Commit

Permalink
Fixing NPE when "se:downloadsEnabled" not set (#13583)
Browse files Browse the repository at this point in the history
Fixes the NPE described in #13578

Co-authored-by: Trig <[email protected]>
  • Loading branch information
Trigtrig and Trigtrig authored Feb 14, 2024
1 parent b6b2096 commit 3338c08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion java/src/org/openqa/selenium/HasDownloads.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface HasDownloads {
* @throws WebDriverException if capability to enable downloads is not set
*/
default void requireDownloadsEnabled(Capabilities capabilities) {
boolean downloadsEnabled = (boolean) capabilities.getCapability("se:downloadsEnabled");
boolean downloadsEnabled = capabilities.is("se:downloadsEnabled");
if (!downloadsEnabled) {
throw new WebDriverException(
"You must enable downloads in order to work with downloadable files.");
Expand Down

0 comments on commit 3338c08

Please sign in to comment.