Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit 8b2b4f3

Browse files
authored
fix: avoid null check exception in the analyzer (#1099)
* fix: try to avoid null check exception * chore: update changelog
1 parent e6c6d86 commit 8b2b4f3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 5.2.1
4+
5+
* fix: avoid null check exception in the analyzer.
6+
37
## 5.2.0
48

59
* fix: remove recursive traversal for [`ban-name`](https://dartcodemetrics.dev/docs/rules/common/ban-name) rule.

lib/src/analyzers/unused_code_analyzer/used_code_visitor.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ class UsedCodeVisitor extends RecursiveAstVisitor<void> {
157157
}
158158

159159
bool _recordConditionalElement(Element element) {
160-
final elementPath = element.source?.fullName;
160+
// ignore: deprecated_member_use
161+
final elementPath = element.enclosingElement3?.source?.fullName;
161162
if (elementPath == null) {
162163
return false;
163164
}

0 commit comments

Comments
 (0)