From 663812633300ea2b64e159137248a140965bf31b Mon Sep 17 00:00:00 2001 From: YuanHu Date: Tue, 6 Sep 2016 11:16:07 +0800 Subject: Protected for Response Null While Deploy Plan-Package to wso2 Change-Id: I4c84d3bb9f94f01e21e605791019e62a78618e13 Signed-off-by: YuanHu --- .../commontosca/catalog/model/plan/wso2/Wso2ServiceConsumer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'catalog-core/catalog-mgr') diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Wso2ServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Wso2ServiceConsumer.java index da52dcd7..48b866e0 100644 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Wso2ServiceConsumer.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/Wso2ServiceConsumer.java @@ -66,6 +66,11 @@ public class Wso2ServiceConsumer { Integer.parseInt(Config.getConfigration().getWso2HostPort()), WSO2_APP_URL, buildRequest(ins, planFilePath)); + if (res.getStatusCode() == null || res.getResult() == null) { + throw new CatalogResourceException( + "Deploy Package return null. Response = " + res); + } + if (200 == res.getStatusCode() || 201 == res.getStatusCode()) { DeployPackageResponse response = new Gson().fromJson(res.getResult(), DeployPackageResponse.class); @@ -182,4 +187,3 @@ public class Wso2ServiceConsumer { } } - -- cgit 1.2.3-korg