mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
DataFlowInspectionBase: null-check
This commit is contained in:
+1
-1
@@ -307,7 +307,7 @@ public class DataFlowInspectionBase extends AbstractBaseJavaLocalInspectionTool
|
||||
DataFlowInstructionVisitor visitor) {
|
||||
visitor.sameValueAssignments().forEach(expr -> {
|
||||
expr = PsiUtil.skipParenthesizedExprDown(expr);
|
||||
if(!reportedAnchors.add(expr)) return;
|
||||
if(expr == null || !reportedAnchors.add(expr)) return;
|
||||
PsiAssignmentExpression assignment = PsiTreeUtil.getParentOfType(expr, PsiAssignmentExpression.class);
|
||||
PsiElement context = PsiTreeUtil.getParentOfType(expr, PsiForStatement.class, PsiClassInitializer.class);
|
||||
if (context instanceof PsiForStatement && PsiTreeUtil.isAncestor(((PsiForStatement)context).getInitialization(), expr, true)) {
|
||||
|
||||
Reference in New Issue
Block a user