You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by he...@apache.org on 2022/03/08 07:08:52 UTC
[incubator-inlong] branch master updated: [INLONG-2993][Manager] Check whether the MQ info is NULL to avoid NPE (#2994)
This is an automated email from the ASF dual-hosted git repository.
healchow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong.git
The following commit(s) were added to refs/heads/master by this push:
new af2f854 [INLONG-2993][Manager] Check whether the MQ info is NULL to avoid NPE (#2994)
af2f854 is described below
commit af2f85456e974f9ae34134be585aaa311e85dcc5
Author: kuansix <49...@qq.com>
AuthorDate: Tue Mar 8 15:08:46 2022 +0800
[INLONG-2993][Manager] Check whether the MQ info is NULL to avoid NPE (#2994)
---
.../inlong/manager/client/api/util/InlongGroupTransfer.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/InlongGroupTransfer.java b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/InlongGroupTransfer.java
index 8e948f5..deb7844 100644
--- a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/InlongGroupTransfer.java
+++ b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/InlongGroupTransfer.java
@@ -65,6 +65,9 @@ public class InlongGroupTransfer {
public static MqBaseConf parseMqBaseConf(InlongGroupResponse inlongGroupResponse) {
InlongGroupMqExtBase mqExtBase = inlongGroupResponse.getMqExtInfo();
+ if (null == mqExtBase || StringUtils.isBlank(mqExtBase.getMiddlewareType())) {
+ return null;
+ }
String middleWare = mqExtBase.getMiddlewareType();
MqType mqType = MqType.forType(middleWare);
switch (mqType) {
@@ -191,8 +194,11 @@ public class InlongGroupTransfer {
groupInfo.setMaxLength(groupConf.getMaxLength());
groupInfo.setProxyClusterId(groupConf.getProxyClusterId());
MqBaseConf mqConf = groupConf.getMqBaseConf();
- MqType mqType = mqConf.getType();
- groupInfo.setMiddlewareType(mqType.name());
+ MqType mqType = MqType.NONE;
+ if (null != mqConf) {
+ mqType = mqConf.getType();
+ groupInfo.setMiddlewareType(mqType.name());
+ }
groupInfo.setInCharges(groupConf.getOperator());
groupInfo.setExtList(Lists.newArrayList());
groupInfo.setCreator(groupConf.getOperator());