You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "funky-eyes (via GitHub)" <gi...@apache.org> on 2024/09/05 02:41:01 UTC
Re: [PR] bugfix:Fix NPE when getting branchType in a non-global transaction context [incubator-seata]
funky-eyes commented on code in PR #6816:
URL: https://github.com/apache/incubator-seata/pull/6816#discussion_r1744728123
##########
compatible/src/main/java/io/seata/core/context/RootContext.java:
##########
@@ -168,7 +172,12 @@ public static void bindBranchType(@Nonnull BranchType branchType) {
*/
@Nullable
public static BranchType unbindBranchType() {
- return convertIoSeata(org.apache.seata.core.context.RootContext.unbindBranchType());
+ org.apache.seata.core.model.BranchType branchType = org.apache.seata.core.context.RootContext.unbindBranchType();
+ if (branchType != null) {
+ return convertIoSeata(branchType);
Review Comment:
为什么不统一放到convertIoSeata这个方法中判空呢?
Why not uniformly put it in the convertIoSeata method to rule out emptiness?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org