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+ 
16## 4.0.1  
27
38-  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 {
257257
258258  @override 
259259  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;
261263    return  element.name ==  _typeName && 
262264        (_inPackage ==  null  || 
263265            (((uri.scheme ==  'dart' ) ==  _inSdk) && 
Original file line number Diff line number Diff line change 11name : source_gen 
2- version : 4.0.1  
2+ version : 4.0.2-wip  
33description : >- 
44  Source code generation builders and utilities for the Dart build system 
55repository : 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() {
208208      );
209209    });
210210
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+ 
211219    group ('isExactlyType' , () {
212220      test ('should not crash with null element' , () {
213221        final  voidType =  core.typeProvider.voidType;
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments