Fix potential null pointers
[aai/champ.git] / champ-service / src / main / java / org / onap / champ / ChampRESTAPI.java
index b312af3..8db8c46 100644 (file)
@@ -155,7 +155,9 @@ public class ChampRESTAPI {
         response = Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();
         LoggingUtil.logInternalError(logger, e);
     } finally {
-      logger.debug(response.getEntity().toString());
+      if (response != null) {
+        logger.debug(response.getEntity().toString());
+      }
       LoggingUtil.logRestRequest(logger, auditLogger, req, response);
       metricsLogger.info(ChampMsgs.PROCESSED_REQUEST, "GET", Long.toString(System.currentTimeMillis() - startTimeInMs));
     }