修改普通类配置取消时,不保留groupid时,空指针的问题

This commit is contained in:
renkaige
2019-01-15 12:04:20 +06:00
parent 660ba23c78
commit 6129a3860e

View File

@@ -1507,7 +1507,8 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
groupId = Long.parseLong(
groupRegion.replace("GROUPREGION:", ""));// 获取真实的groupid
}
if (!keepGroupIdList.contains(groupId)) {// 如果不是需要保留的groupid则失效(公共组不失效[如需失效使用公共组失效接口],非公共组则失效)
if (keepGroupIdList == null || keepGroupIdList.size() == 0
|| !keepGroupIdList.contains(groupId)) {// 如果不是需要保留的groupid则失效(公共组不失效[如需失效使用公共组失效接口],非公共组则失效)
groupRegionVal = groupRegionVal
.replace("EFFECTIVE_RULE", "OBSOLETE_RULE");
String[] split = org.apache.commons.lang.StringUtils
@@ -1536,10 +1537,10 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
}
} catch (Exception e) {
throw new ServiceRuntimeException("" + idRelaRedisDBIndex
+ "号redis库中删除" + groupRegion
+ "失败,redis中不存在该值,请联系开发人员检查删除逻辑是否正确或redis数据是否出现了异常",
RestBusinessCode.KeyNotExistsInRedis.getValue());
throw new ServiceRuntimeException(
"" + idRelaRedisDBIndex + "号redis库中删除" + groupRegion
+ "失败,失败原因:" + ExceptionUtil.getExceptionMsg(e),
RestBusinessCode.DeleteDataInError.getValue());
}
}
//
@@ -1773,9 +1774,9 @@ public class ConfigJedisServiceimpl implements ConfigRedisService {
updateMaatInfo(expressionList, obsoleteKey, transaction, maatVersion, everyDb, true);
}
}
}else {
throw new ServiceRuntimeException("修改公共组域配置时,无法获取到groupid="+groupId+"的公共组,请检查配置参数是否正确",
RestBusinessCode.ConfigSourceIsNull.getValue());
} else {
throw new ServiceRuntimeException("修改公共组域配置时,无法获取到groupid=" + groupId + "的公共组,请检查配置参数是否正确",
RestBusinessCode.ConfigSourceIsNull.getValue());
}
}