From baba6d12862752c04b2ebb60ad1ac66ed538a935 Mon Sep 17 00:00:00 2001 From: vinoth959 Date: Wed, 26 Oct 2022 04:17:39 -0400 Subject: [PATCH] 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 --- java/src/org/openqa/selenium/internal/Require.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/src/org/openqa/selenium/internal/Require.java b/java/src/org/openqa/selenium/internal/Require.java index 64c75432b1d89..d728a00d447c6 100644 --- a/java/src/org/openqa/selenium/internal/Require.java +++ b/java/src/org/openqa/selenium/internal/Require.java @@ -138,6 +138,9 @@ public static int positive(String argName, Integer number, String message) { } public static double positive(String argName, Double number, String message) { + if (number == null) { + throw new IllegalArgumentException(String.format(MUST_BE_SET, argName)); + } if (number <= 0) { if (message == null) { throw new IllegalArgumentException(String.format(MUST_BE_POSITIVE, argName));