Skip to content

Commit

Permalink
bugfix:Fix NPE when getting branchType in a non-global transaction co…
Browse files Browse the repository at this point in the history
…ntext (#6816)
  • Loading branch information
xingfudeshi authored Sep 5, 2024
1 parent 242d92c commit e62a9b9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6624](https://github.com/apache/incubator-seata/pull/6624)] fix Alibaba Dubbo convert error
- [[#6627](https://github.com/apache/incubator-seata/pull/6627)] fix the issue of xaEnded not being reset
- [[#6626](https://github.com/apache/incubator-seata/pull/6626)] fix hsf ConsumerModel convert error
- [[#6816](https://github.com/apache/incubator-seata/pull/6816)] Fix NPE when getting branchType in a non-global transaction context
- [[#6642](https://github.com/apache/incubator-seata/pull/6642)] codecov token not found
- [[#6661](https://github.com/apache/incubator-seata/pull/6661)] fix `tableMeta` cache scheduled refresh issue
- [[#6486](https://github.com/apache/incubator-seata/pull/6486)] fix mysql undo log update sql data more than max allowed packet
Expand Down Expand Up @@ -126,6 +127,6 @@ Thanks to these contributors for their code commits. Please report an unintended
- [lightClouds917](https://github.com/lightClouds917)
- [l81893521](https://github.com/l81893521)
- [laywin](https://github.com/laywin)

- [xingfudeshi](https://github.com/xingfudeshi)

Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
7 changes: 3 additions & 4 deletions changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [[#6624](https://github.com/apache/incubator-seata/pull/6624)] 修复 Alibaba Dubbo 转换错误
- [[#6627](https://github.com/apache/incubator-seata/pull/6627)] 修复 xaEnded 没有重置
- [[#6626](https://github.com/apache/incubator-seata/pull/6626)] 修复 hsf ConsumerModel 转换错误
- [[#6816](https://github.com/apache/incubator-seata/pull/6816)] 修复在非全局事务上下文中获取branchType时的NPE问题
- [[#6640](https://github.com/apache/incubator-seata/pull/6640)] 优化codecov相关配置
- [[#6642](https://github.com/apache/incubator-seata/pull/6642)] 修复codecov token找不到导致无法提交单测覆盖度报告
- [[#6661](https://github.com/apache/incubator-seata/pull/6661)] 修复`tableMeta`缓存定时刷新失效问题
Expand All @@ -32,8 +33,7 @@
- [[#6781](https://github.com/apache/incubator-seata/pull/6781)] 修复tc下线时,由于定时任务没有先关闭,导致下线后还会被注册上,需要靠namingserver的健康检查来下线的bug
- [[#6797](https://github.com/apache/incubator-seata/pull/6797)] 当查询的集群地址为空时,获取可用的任意集群地址
- [[#6800](https://github.com/apache/incubator-seata/pull/6800)] 使异常消息对所有数据库驱动程序通用
- - [[#6812](https://github.com/apache/incubator-seata/pull/6812)] 修复切换事务分组和节点下线时namingserver没有实时感知和推送的bug

- [[#6812](https://github.com/apache/incubator-seata/pull/6812)] 修复切换事务分组和节点下线时namingserver没有实时感知和推送的bug
- [[#6759](https://github.com/apache/incubator-seata/pull/6759)] 修复跨库表主动刷新`tableMeta`的异常问题

### optimize:
Expand Down Expand Up @@ -128,8 +128,7 @@
- [lightClouds917](https://github.com/lightClouds917)
- [l81893521](https://github.com/l81893521)
- [laywin](https://github.com/laywin)


- [xingfudeshi](https://github.com/xingfudeshi)

同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package io.seata.core.context;


import java.util.Map;

import javax.annotation.Nonnull;
Expand All @@ -42,7 +43,11 @@ public class RootContext {
public static final String KEY_BRANCH_TYPE = "TX_BRANCH_TYPE";

private static BranchType convertIoSeata(org.apache.seata.core.model.BranchType branchType) {
return BranchType.get(branchType.name());
if (branchType == null) {
return null;
} else {
return BranchType.get(branchType.name());
}
}

/**
Expand Down

0 comments on commit e62a9b9

Please sign in to comment.