This is an automated email from the ASF dual-hosted git repository.

pefernan pushed a commit to branch quarkus-3.2LTS
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-apps.git


The following commit(s) were added to refs/heads/quarkus-3.2LTS by this push:
     new 0773db5b4 - Fix Oracle IT Tests (#1931)
0773db5b4 is described below

commit 0773db5b4740f9e8487a7c1c77def5e0768017df
Author: Pere Fernández <[email protected]>
AuthorDate: Thu Dec 7 16:06:48 2023 +0100

    - Fix Oracle IT Tests (#1931)
---
 .../org/kie/kogito/persistence/oracle/hibernate/JsonBinaryType.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/persistence-commons/persistence-commons-oracle/src/main/java/org/kie/kogito/persistence/oracle/hibernate/JsonBinaryType.java
 
b/persistence-commons/persistence-commons-oracle/src/main/java/org/kie/kogito/persistence/oracle/hibernate/JsonBinaryType.java
index 667e799f6..1c945b5dd 100644
--- 
a/persistence-commons/persistence-commons-oracle/src/main/java/org/kie/kogito/persistence/oracle/hibernate/JsonBinaryType.java
+++ 
b/persistence-commons/persistence-commons-oracle/src/main/java/org/kie/kogito/persistence/oracle/hibernate/JsonBinaryType.java
@@ -64,12 +64,12 @@ public class JsonBinaryType implements UserType<JsonNode> {
     @Override
     public JsonNode nullSafeGet(ResultSet rs, int position, 
SharedSessionContractImplementor session, Object owner)
             throws HibernateException, SQLException {
-        final Blob json = rs.getBlob(position);
-        if (json.length() == 0) {
+        final Blob blob = rs.getBlob(position);
+        if (blob == null || blob.length() == 0) {
             return null;
         }
         try {
-            return mapper.readTree(json.getBinaryStream());
+            return mapper.readTree(blob.getBinaryStream());
         } catch (final Exception ex) {
             throw new RuntimeException("Failed to convert String to JSON: " + 
ex.getMessage(), ex);
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to