aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprakash.e <prakash.e@huawei.com>2021-05-27 20:37:59 +0530
committerprakash.e <prakash.e@huawei.com>2021-05-28 14:04:55 +0530
commitbb1ff921e73fa0e7238e259ae3293e9b097b2588 (patch)
tree94f2f5c3198316dedeb839fd5909800217d33c7c
parent446aa2332ac983710f712ff7de2b12d468d836a7 (diff)
Fix for Profile list RestAPI when profile is empty
Change-Id: I664509037346758fade84c3cd84310a4f9ab87f4 Issue-ID: VNFSDK-785 Signed-off-by: Prakash.E <prakash.e@huawei.com>
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/profile/VTPProfileResource.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/profile/VTPProfileResource.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/profile/VTPProfileResource.java
index a5c601da..cbb01a8d 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/profile/VTPProfileResource.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vtp/profile/VTPProfileResource.java
@@ -76,7 +76,9 @@ public class VTPProfileResource extends VTPResource {
for (Iterator<JsonElement> it = resultsArray.iterator(); it.hasNext();) {
JsonElement jsonElement = it.next();
JsonObject n = jsonElement.getAsJsonObject();
- list.getTestProfiles().add(new VTPTestProfile().setName(n.get("profile").getAsString()));
+ if (n.has("profile")){
+ list.getTestProfiles().add(new VTPTestProfile().setName(n.get("profile").getAsString()));
+ }
}
}