# RegexpURLValidator throws NPE when URL has no authority component

**URL:** <https://discourse.hibernate.org/t/regexpurlvalidator-throws-npe-when-url-has-no-authority-component/12361>\
**Category:** Hibernate Validator\
**Created:** [July 6, 2026, 8:49am UTC](https://discourse.hibernate.org/t/regexpurlvalidator-throws-npe-when-url-has-no-authority-component/12361 "2026-07-06T08:49:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![burl21](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/burl21/32/4343_2.png) [@burl21](https://discourse.hibernate.org/u/burl21)\
**Post date:** [July 6, 2026, 8:49am UTC](https://discourse.hibernate.org/t/regexpurlvalidator-throws-npe-when-url-has-no-authority-component/12361/1 "2026-07-06T08:49:08Z")

</div>

`RegexpURLValidator.isValid()` calls `DomainNameUtil.isValidDomainAddress(values.getHost())` without null checking the host. The host is extracted from `URL_REGEX` capture group 2, which is null when the input has no authority component (e.g. `http:host.com` missing `//`). The regex still matches, so `parseUrl()` returns a non null `ValueHolder` with a null host, and `DomainNameUtil.isValidDomainAddress(null)` throws NPE at line 78.

Version: hibernate-validator-9.1.0.Final

I’m not sure if this is the right place to report this issue. If not, please point me in the right direction. Thanks

---

<div class="post-metadata">

**Author:** ![yrodiere](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/yrodiere/32/1760_2.png) [@yrodiere](https://discourse.hibernate.org/u/yrodiere)\
**Post date:** [July 6, 2026, 9:11am UTC](https://discourse.hibernate.org/t/regexpurlvalidator-throws-npe-when-url-has-no-authority-component/12361/2 "2026-07-06T09:11:11Z")

</div>

Please report issues on the issue tracker: [Jira](https://hibernate.atlassian.net/browse/HV)

See also [Come and join us! - Hibernate](https://hibernate.org/community/)

---

<div class="post-metadata">

**Author:** ![burl21](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/burl21/32/4343_2.png) [@burl21](https://discourse.hibernate.org/u/burl21)\
**Post date:** [July 6, 2026, 9:29am UTC](https://discourse.hibernate.org/t/regexpurlvalidator-throws-npe-when-url-has-no-authority-component/12361/3 "2026-07-06T09:29:39Z")

</div>

Thanks, my problem is that I don’t have a Jira account. I’ll go ahead and create one.

---

<div class="post-metadata">

**Author:** ![burl21](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/burl21/32/4343_2.png) [@burl21](https://discourse.hibernate.org/u/burl21)\
**Post date:** [July 6, 2026, 9:50am UTC](https://discourse.hibernate.org/t/regexpurlvalidator-throws-npe-when-url-has-no-authority-component/12361/4 "2026-07-06T09:50:19Z")

</div>

I created the account but I can’t open an issue:  
“You do not have permission to perform this operation. Please log in. Close this window and press reload in your browser.” Also, most of the time the “+ Create” button doesn’t work at all.

---

<div class="post-metadata">

**Author:** ![mbekhta](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/mbekhta/32/2044_2.png) [@mbekhta](https://discourse.hibernate.org/u/mbekhta)\
**Post date:** [July 6, 2026, 9:53am UTC](https://discourse.hibernate.org/t/regexpurlvalidator-throws-npe-when-url-has-no-authority-component/12361/5 "2026-07-06T09:53:25Z")

</div>

Hey, there’s a known issue with Jira .. see this thread on how to deal with this: [#hibernate-user \> Jira issue creation @ 💬](https://hibernate.zulipchat.com/#narrow/channel/132096-hibernate-user/topic/Jira.20issue.20creation/near/602212940)
