Skip to content

Commit

Permalink
Fixing NPE when "se:downloadsEnabled" not set
Browse files Browse the repository at this point in the history
Fixes the NPE described in #13578
  • Loading branch information
Trigtrig committed Feb 14, 2024
1 parent b6b2096 commit cb18a11
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 cb18a11

Please sign in to comment.