From d08ba4606387062e887d57bc7037fb64d1a2ff0b Mon Sep 17 00:00:00 2001 From: tanghc Date: Mon, 2 Mar 2020 08:48:59 +0800 Subject: [PATCH] 3.1.0 --- .../gitee/sop/gatewaycommon/result/BaseExecutorAdapter.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/result/BaseExecutorAdapter.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/result/BaseExecutorAdapter.java index ca9dc0e8..931d7f84 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/result/BaseExecutorAdapter.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/result/BaseExecutorAdapter.java @@ -159,7 +159,7 @@ public abstract class BaseExecutorAdapter implements ResultExecutor */ protected boolean isMergeResult(T request) { ApiParam params = this.getApiParam(request); - return params.fetchMergeResult(); + return params != null && params.fetchMergeResult(); } protected String formatResult(String serviceResult) { @@ -176,6 +176,10 @@ public abstract class BaseExecutorAdapter implements ResultExecutor public String merge(T exchange, JSONObject responseData) { JSONObject finalData = new JSONObject(true); ApiParam params = this.getApiParam(exchange); + if (params == null) { + params = new ApiParam(); + params.setName("error"); + } ApiConfig apiConfig = ApiConfig.getInstance(); // 点换成下划线 DataNameBuilder dataNameBuilder = apiConfig.getDataNameBuilder();