diff --git a/components/org.wso2.carbon.identity.captcha/src/main/java/org/wso2/carbon/identity/captcha/util/CaptchaUtil.java b/components/org.wso2.carbon.identity.captcha/src/main/java/org/wso2/carbon/identity/captcha/util/CaptchaUtil.java index d8abefa5a7..4fd1af1b01 100644 --- a/components/org.wso2.carbon.identity.captcha/src/main/java/org/wso2/carbon/identity/captcha/util/CaptchaUtil.java +++ b/components/org.wso2.carbon.identity.captcha/src/main/java/org/wso2/carbon/identity/captcha/util/CaptchaUtil.java @@ -622,12 +622,8 @@ private static void setReCaptchaConfigs(Properties properties) { throw new RuntimeException(getValidationErrorMessage(CaptchaConstants.RE_CAPTCHA_SCORE_THRESHOLD)); } - try { - Double reCaptchaWarnScoreThreshold = getReCaptchaWarnThreshold(properties); - CaptchaDataHolder.getInstance().setReCaptchaWarnScoreThreshold(reCaptchaWarnScoreThreshold); - } catch (NumberFormatException e) { - throw new RuntimeException(getValidationErrorMessage(CaptchaConstants.RE_CAPTCHA_WARN_SCORE_THRESHOLD)); - } + double reCaptchaWarnScoreThreshold = getReCaptchaWarnThreshold(properties); + CaptchaDataHolder.getInstance().setReCaptchaWarnScoreThreshold(reCaptchaWarnScoreThreshold); String forcefullyEnableRecaptchaForAllTenants = properties.getProperty(CaptchaConstants.FORCEFULLY_ENABLED_RECAPTCHA_FOR_ALL_TENANTS); @@ -672,7 +668,12 @@ private static double getReCaptchaWarnThreshold(Properties properties) throws Nu } return CaptchaConstants.CAPTCHA_V3_DEFAULT_WARN_THRESHOLD; } - return Double.parseDouble(warnThreshold); + try { + return Double.parseDouble(warnThreshold); + } catch (NumberFormatException e) { + log.warn("NumberFormatException for ReCaptcha warn score threshold. Using default value."); + return CaptchaConstants.CAPTCHA_V3_DEFAULT_WARN_THRESHOLD; + } } private static void setSSOLoginConnectorConfigs(Properties properties) {