Adjusting check condition for ZipOutputStream
[sdc.git] / 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();