File tree Expand file tree Collapse file tree 4 files changed +17
-2
lines changed Expand file tree Collapse file tree 4 files changed +17
-2
lines changed Original file line number Diff line number Diff line change
1
+ ## 4.0.2-wip
2
+
3
+ - Bug fix: fix possible null pointer exception in ` TypeChecker.typeNamed ` on
4
+ invalid code.
5
+
1
6
## 4.0.1
2
7
3
8
- Require ` analyzer: '>=8.1.1 <9.0.0' ` .
Original file line number Diff line number Diff line change @@ -257,7 +257,9 @@ class _NameTypeChecker extends TypeChecker {
257
257
258
258
@override
259
259
bool isExactly (Element element) {
260
- final uri = element.library! .uri;
260
+ final library = element.library;
261
+ if (library == null ) return false ;
262
+ final uri = library.uri;
261
263
return element.name == _typeName &&
262
264
(_inPackage == null ||
263
265
(((uri.scheme == 'dart' ) == _inSdk) &&
Original file line number Diff line number Diff line change 1
1
name : source_gen
2
- version : 4.0.1
2
+ version : 4.0.2-wip
3
3
description : >-
4
4
Source code generation builders and utilities for the Dart build system
5
5
repository : https://github.com/dart-lang/source_gen/tree/master/source_gen
Original file line number Diff line number Diff line change @@ -208,6 +208,14 @@ void main() {
208
208
);
209
209
});
210
210
211
+ group ('isExactly' , () {
212
+ test ('should not crash with null library' , () {
213
+ final element = core.typeProvider.dynamicType.element! ;
214
+ expect (element.library, isNull);
215
+ expect (checkMapMixin ().isExactly (element), isFalse);
216
+ });
217
+ });
218
+
211
219
group ('isExactlyType' , () {
212
220
test ('should not crash with null element' , () {
213
221
final voidType = core.typeProvider.voidType;
You can’t perform that action at this time.
0 commit comments