From: Michael Reece Date: Thu, 16 Aug 2018 12:03:16 +0000 (+0100) Subject: Update to stop exception for null transaction id X-Git-Tag: 1.3.0~9 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=efea6a331525b6b1a1ef21eeca3ccd8fa86a36c5;p=aai%2Fchamp.git Update to stop exception for null transaction id Fixed issue on endpoint objects/relationships/ to prevent exception being thrown when transaction id passed to GET request is null Issue-ID: AAI-1439 Change-Id: Ib2a77063391612851149174a8bcfe356135d06ce Signed-off-by: Michael Reece --- diff --git a/champ-service/src/main/java/org/onap/champ/ChampRESTAPI.java b/champ-service/src/main/java/org/onap/champ/ChampRESTAPI.java index 58db3be..1f9400f 100644 --- a/champ-service/src/main/java/org/onap/champ/ChampRESTAPI.java +++ b/champ-service/src/main/java/org/onap/champ/ChampRESTAPI.java @@ -289,7 +289,7 @@ public class ChampRESTAPI { httpHeadersValidator.validateRequestHeaders(headers); ChampTransaction transaction = tId == null ? null : champDataService.getTransaction(tId); - if (transaction == null) { + if (tId != null && transaction == null) { throw new ChampServiceException("No transaction found for transaction ID: " + tId, Status.BAD_REQUEST); } retrieved = champDataService.getRelationshipsByObject(oId, Optional.ofNullable(transaction));