Adjusting check condition for ZipOutputStream 16/111216/4
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>
Mon, 10 Aug 2020 12:27:50 +0000 (13:27 +0100)
committerSébastien Determe <sebastien.determe@intl.att.com>
Mon, 7 Sep 2020 05:34:30 +0000 (05:34 +0000)
Issue-ID: SDC-3226
Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
Change-Id: I49e8916e23a7883832a02e6f294fd3f2a537f3a2

catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java

index 241148b..f378ca0 100644 (file)
@@ -278,8 +278,10 @@ public class CsarUtils {
         }
 
         //UID <cassandraId,filename,component>
-        Either<ZipOutputStream, ResponseFormat> responseFormat = getZipOutputStreamResponseFormatEither(zip, dependencies);
-        if (responseFormat != null) return responseFormat;
+        Either<ZipOutputStream, ResponseFormat> zipOutputStreamOrResponseFormat = getZipOutputStreamResponseFormatEither(zip, dependencies);
+        if (zipOutputStreamOrResponseFormat != null && zipOutputStreamOrResponseFormat.isRight()) {
+                return zipOutputStreamOrResponseFormat;
+        }
 
         //retrieve SDC.zip from Cassandra
         Either<byte[], ResponseFormat> latestSchemaFilesFromCassandra = getLatestSchemaFilesFromCassandra();