-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: fix throw NPE when get the state list #2949
Conversation
@long187 ,麻烦review一下。 |
Codecov Report
@@ Coverage Diff @@
## develop #2949 +/- ##
=============================================
+ Coverage 50.57% 50.58% +0.01%
+ Complexity 3105 3104 -1
=============================================
Files 599 599
Lines 19510 19510
Branches 2406 2407 +1
=============================================
+ Hits 9868 9870 +2
+ Misses 8650 8649 -1
+ Partials 992 991 -1
|
Codecov Report
@@ Coverage Diff @@
## develop #2949 +/- ##
=============================================
- Coverage 50.93% 50.57% -0.37%
+ Complexity 3221 3162 -59
=============================================
Files 605 598 -7
Lines 19887 19702 -185
Branches 2481 2442 -39
=============================================
- Hits 10130 9964 -166
- Misses 8743 8749 +6
+ Partials 1014 989 -25
|
这段逻辑主要是怕从statemachineInstance里拿到的stateList为空,因为要恢复时可能只查询了statemachineInstance对象没有级联查询stateInstance列表,所以这里做了一个双保险,如果stateList为空,则查询一次。所以这里我建议在你改的基础上再判断一下stateList是不是为空,如果为空则用之前else里那段代码查询一次。 |
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. Describe what this PR did
optimize: opt SAGA CompensationTriggerStateHandler
此处的stateMachineInstance必定存在,无需判断空值。
而且else处代码逻辑也有问题,即使进入else了,也是必定NPE。
Ⅱ. Does this pull request fix one issue?
fixes #2925
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews