1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

Fix crash at first start when 'userInfoBox' does not contain 'serverEndpointKey' before API service is initialized (#1362)

This commit is contained in:
Matthias Rupp 2023-01-19 20:06:57 +01:00 committed by GitHub
parent 753d81adad
commit a8cbda5f24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,8 +20,8 @@ class ApiService {
ApiService() {
if (Hive.isBoxOpen(userInfoBox)) {
final endpoint = Hive.box(userInfoBox).get(serverEndpointKey) as String;
if (endpoint.isNotEmpty) {
final endpoint = Hive.box(userInfoBox).get(serverEndpointKey) as String?;
if (endpoint != null && endpoint.isNotEmpty) {
setEndpoint(endpoint);
}
} else {