diff options
author | prakash.e <prakash.e@huawei.com> | 2021-05-27 20:37:59 +0530 |
---|---|---|
committer | prakash.e <prakash.e@huawei.com> | 2021-05-28 14:04:55 +0530 |
commit | bb1ff921e73fa0e7238e259ae3293e9b097b2588 (patch) | |
tree | 94f2f5c3198316dedeb839fd5909800217d33c7c | |
parent | 446aa2332ac983710f712ff7de2b12d468d836a7 (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.java | 4 |
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())); + } } } |