# NullPointerException from BooleanJavaType

**URL:** <https://discourse.hibernate.org/t/nullpointerexception-from-booleanjavatype/8314>\
**Category:** Hibernate ORM\
**Created:** [September 28, 2023, 1:07pm UTC](https://discourse.hibernate.org/t/nullpointerexception-from-booleanjavatype/8314 "2023-09-28T13:07:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![perfri](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/perfri/32/2351_2.png) [@perfri](https://discourse.hibernate.org/u/perfri)\
**Post date:** [September 28, 2023, 1:07pm UTC](https://discourse.hibernate.org/t/nullpointerexception-from-booleanjavatype/8314/1 "2023-09-28T13:07:49Z")

</div>

I tried to upgrade to latest 6.3.1 but I got an NullPointerException during startup when trying to convert values from a database Number column to a Java Boolean value in one our entities.  
We have a converter that converts database null values to false and Number 1 to true and vice versa. Since our converter returns null in convertToDatabaseColumn (which we must do since there are other legacy systems that uses the same db and use null as false) and Hibernate in row 203 in BooleanJavaType.java tries to call .longValue() on a null that throws an exception.  
We have been using Hibernate 6.2.7 succesfully previously.

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [September 29, 2023, 6:50am UTC](https://discourse.hibernate.org/t/nullpointerexception-from-booleanjavatype/8314/2 "2023-09-29T06:50:44Z")

</div>

Hi there. This is a bug, so please create an issue in our issue tracker: [https://hibernate.atlassian.net](https://hibernate.atlassian.net)

---

<div class="post-metadata">

**Author:** ![perfri](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/perfri/32/2351_2.png) [@perfri](https://discourse.hibernate.org/u/perfri)\
**Post date:** [October 2, 2023, 5:53am UTC](https://discourse.hibernate.org/t/nullpointerexception-from-booleanjavatype/8314/3 "2023-10-02T05:53:47Z")

</div>

Issue created  
[https://hibernate.atlassian.net/browse/HHH-17275](https://hibernate.atlassian.net/browse/HHH-17275)
