Skip to content

Commit

Permalink
Fix null pointer exception in references (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
jathak authored Dec 6, 2022
1 parent 8803576 commit 1d4c3b9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.7.2

### Module Migrator

* Fixes a rare crash in certain cases involving reassignments of variables from
another module.

## 1.7.1

* Eliminates invalid warnings when running `--migrate-deps` on a file that
Expand Down
5 changes: 2 additions & 3 deletions lib/src/migrators/module/references.dart
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,8 @@ class _ReferenceVisitor with RecursiveStatementVisitor, RecursiveAstVisitor {
var declaration = _scopeForNamespace(namespace).findVariable(node.name);
if (declaration != null && !_fromForwardRuleInCurrent(declaration)) {
_variables[node] = declaration;
if (declaration.member is VariableDeclaration) {
_sources[node] = _declarationSources[declaration]!;
}
var source = _declarationSources[declaration];
if (source != null) _sources[node] = source;
} else if (namespace == null) {
_unresolvedReferences[node] = _scope;
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass_migrator
version: 1.7.1
version: 1.7.2
description: A tool for running migrations on Sass files
homepage: https://github.com/sass/migrator

Expand Down

0 comments on commit 1d4c3b9

Please sign in to comment.