We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fba3cbc commit 3ceda6bCopy full SHA for 3ceda6b
source_gen/CHANGELOG.md
@@ -1,3 +1,8 @@
1
+## 4.0.2-wip
2
+
3
+- Bug fix: fix possible null pointer exception in `TypeChecker.typeNamed` on
4
+ invalid code.
5
6
## 4.0.1
7
8
- Require `analyzer: '>=8.1.1 <9.0.0'`.
source_gen/lib/src/type_checker.dart
@@ -257,7 +257,9 @@ class _NameTypeChecker extends TypeChecker {
257
258
@override
259
bool isExactly(Element element) {
260
- final uri = element.library!.uri;
+ final library = element.library;
261
+ if (library == null) return false;
262
+ final uri = library.uri;
263
return element.name == _typeName &&
264
(_inPackage == null ||
265
(((uri.scheme == 'dart') == _inSdk) &&
0 commit comments