From 36b62be84b398044e1feae657c662dba6247782f Mon Sep 17 00:00:00 2001 From: Instrumental Date: Thu, 29 Mar 2018 20:26:02 -0500 Subject: Clean up Sonar results 2 Issue-ID: AAF-206 Change-Id: Ia000b144be58af970f4a5264ca5a9718fdbf9f5d Signed-off-by: Instrumental --- .../auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'auth/auth-cass/src/main/java/org') diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java index 7a85ae1a..76e3b424 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java @@ -185,8 +185,10 @@ public class CredDAO extends CassDAOImpl { data.cred=null; if(i>=0) { byte[] bytes = new byte[i]; // a bit dangerous, but lessened because of all the previous sized data reads - is.read(bytes); - data.cred = ByteBuffer.wrap(bytes); + int read = is.read(bytes); + if(read>0) { + data.cred = ByteBuffer.wrap(bytes); + } } } } -- cgit 1.2.3-korg