Skip to content

Commit

Permalink
Merge branch 'master' into rule_renames2
Browse files Browse the repository at this point in the history
  • Loading branch information
pq committed Mar 14, 2017
2 parents 1321c2c + 429b1f8 commit 8074da2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/src/rules/invariant_booleans.dart
Expand Up @@ -313,7 +313,8 @@ class _Visitor extends SimpleAstVisitor {

_reportExpressionIfConstantValue(Expression node) {
// Right part discards reporting a subexpression already reported.
if (resolutionMap.bestTypeForExpression(node).name != 'bool' ||
if (node == null ||
resolutionMap.bestTypeForExpression(node).name != 'bool' ||
!_isAnalyzedNode(node.parent)) {
return;
}
Expand Down
3 changes: 2 additions & 1 deletion lib/src/rules/prefer_initializing_formals.dart
Expand Up @@ -109,7 +109,8 @@ class _Visitor extends SimpleAstVisitor {
bool isConstructorFieldInitializerToLint(
ConstructorFieldInitializer constructorFieldInitializer) {
final expression = constructorFieldInitializer.expression;
return !constructorFieldInitializer.fieldName.bestElement.isPrivate &&
return !(constructorFieldInitializer.fieldName.bestElement?.isPrivate ??
true) &&
expression is SimpleIdentifier &&
parameters.contains(expression.bestElement);
}
Expand Down

0 comments on commit 8074da2

Please sign in to comment.