File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -836,6 +836,8 @@ class Avatar extends StatelessWidget {
836836
837837/// The appropriate avatar image for a user ID. 
838838/// 
839+ /// If the user isn't found, gives a [SizedBox.shrink] . 
840+ /// 
839841/// Wrap this with [AvatarShape] . 
840842class  AvatarImage  extends  StatelessWidget  {
841843  const  AvatarImage ({
@@ -848,7 +850,11 @@ class AvatarImage extends StatelessWidget {
848850  @override 
849851  Widget  build (BuildContext  context) {
850852    final  store =  PerAccountStoreWidget .of (context);
851-     final  user =  store.users[userId]! ;
853+     final  user =  store.users[userId];
854+ 
855+     if  (user ==  null ) { // TODO(log) 
856+       return  const  SizedBox .shrink ();
857+     }
852858
853859    final  resolvedUrl =  switch  (user.avatarUrl) {
854860      null           =>  null , // TODO(#255): handle computing gravatars 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments