mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:27:09 -05:00 
			
		
		
		
	Fix crash at first start when 'userInfoBox' does not contain 'serverEndpointKey' before API service is initialized (#1362)
This commit is contained in:
		
							parent
							
								
									753d81adad
								
							
						
					
					
						commit
						a8cbda5f24
					
				@ -20,8 +20,8 @@ class ApiService {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  ApiService() {
 | 
					  ApiService() {
 | 
				
			||||||
    if (Hive.isBoxOpen(userInfoBox)) {
 | 
					    if (Hive.isBoxOpen(userInfoBox)) {
 | 
				
			||||||
      final endpoint = Hive.box(userInfoBox).get(serverEndpointKey) as String;
 | 
					      final endpoint = Hive.box(userInfoBox).get(serverEndpointKey) as String?;
 | 
				
			||||||
      if (endpoint.isNotEmpty) {
 | 
					      if (endpoint != null && endpoint.isNotEmpty) {
 | 
				
			||||||
        setEndpoint(endpoint);
 | 
					        setEndpoint(endpoint);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user