Skip to content

Commit 1d4c3b9

Browse files
authored
Fix null pointer exception in references (#236)
1 parent 8803576 commit 1d4c3b9

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.7.2
2+
3+
### Module Migrator
4+
5+
* Fixes a rare crash in certain cases involving reassignments of variables from
6+
another module.
7+
18
## 1.7.1
29

310
* Eliminates invalid warnings when running `--migrate-deps` on a file that

lib/src/migrators/module/references.dart

+2-3
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,8 @@ class _ReferenceVisitor with RecursiveStatementVisitor, RecursiveAstVisitor {
638638
var declaration = _scopeForNamespace(namespace).findVariable(node.name);
639639
if (declaration != null && !_fromForwardRuleInCurrent(declaration)) {
640640
_variables[node] = declaration;
641-
if (declaration.member is VariableDeclaration) {
642-
_sources[node] = _declarationSources[declaration]!;
643-
}
641+
var source = _declarationSources[declaration];
642+
if (source != null) _sources[node] = source;
644643
} else if (namespace == null) {
645644
_unresolvedReferences[node] = _scope;
646645
}

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass_migrator
2-
version: 1.7.1
2+
version: 1.7.2
33
description: A tool for running migrations on Sass files
44
homepage: https://github.com/sass/migrator
55

0 commit comments

Comments
 (0)