Skip to content

Commit baba6d1

Browse files
vinoth959diemol
andauthored
Updated IllegalArgumentException to NullPointerException for Null Values in Require Class (#11162)
* Update Require.java Update IllegealStateException to NullPointerException as the exception misleads in debugging. * Update Require.java * Update Require.java * Update Require.java Co-authored-by: Diego Molina <[email protected]>
1 parent 851cb0d commit baba6d1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

java/src/org/openqa/selenium/internal/Require.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ public static int positive(String argName, Integer number, String message) {
138138
}
139139

140140
public static double positive(String argName, Double number, String message) {
141+
if (number == null) {
142+
throw new IllegalArgumentException(String.format(MUST_BE_SET, argName));
143+
}
141144
if (number <= 0) {
142145
if (message == null) {
143146
throw new IllegalArgumentException(String.format(MUST_BE_POSITIVE, argName));

0 commit comments

Comments
 (0)