Merge "Issue-ID: PORTAL-913 optimization in git clone using --depth"
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / controller / MicroserviceProxyController.java
index 134d99e..8bf9354 100644 (file)
@@ -53,9 +53,7 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.client.HttpClientErrorException;
 
@@ -105,9 +103,16 @@ public class MicroserviceProxyController extends EPUnRestrictedBaseController {
         */
        private boolean isValidJSON(String response) {
                try {
+                       if(response != null && !response.isEmpty())
+                       {
                        final ObjectMapper mapper = new ObjectMapper();
                        mapper.readTree(response);
                        return true;
+                       }
+                       else
+                       {
+                       return false;
+                       }
                } catch (IOException e) {
                        logger.debug(EELFLoggerDelegate.debugLogger, "isValidJSON failed", e);
                        return false;