Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
null-check fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pq committed Feb 12, 2021
1 parent d897e72 commit cbeb372
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/src/util/tested_expressions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ bool _isComparison(Expression expression) =>
BooleanExpressionUtilities.COMPARISONS.contains(expression.operator.type);

bool _isNegationOrComparison(
TokenType? cOperatorType, TokenType eOperatorType, TokenType tokenType) {
TokenType cOperatorType, TokenType eOperatorType, TokenType tokenType) {
final isNegationOperation =
cOperatorType == BooleanExpressionUtilities.NEGATIONS[eOperatorType] ||
BooleanExpressionUtilities.IMPLICATIONS[cOperatorType!] ==
BooleanExpressionUtilities.IMPLICATIONS[cOperatorType] ==
BooleanExpressionUtilities.NEGATIONS[eOperatorType];

final isTrichotomyConjunction = BooleanExpressionUtilities
Expand Down Expand Up @@ -167,12 +167,13 @@ class TestedExpressions {
? BooleanExpressionUtilities
.NEGATIONS[otherExpression.operator.type]
: otherExpression.operator.type;
final isNegationOrComparison =
_isNegationOrComparison(cOperatorType, eOperatorType, tokenType);

if (isNegationOrComparison && sameOperands) {
contradictions
.add(ContradictoryComparisons(otherExpression, expression));
if (cOperatorType != null) {
final isNegationOrComparison =
_isNegationOrComparison(cOperatorType, eOperatorType, tokenType);
if (isNegationOrComparison && sameOperands) {
contradictions
.add(ContradictoryComparisons(otherExpression, expression));
}
}
});
});
Expand Down

0 comments on commit cbeb372

Please sign in to comment.