diff --git a/mobile/lib/shared/services/api.service.dart b/mobile/lib/shared/services/api.service.dart index 3251883e72..8f8a7c4770 100644 --- a/mobile/lib/shared/services/api.service.dart +++ b/mobile/lib/shared/services/api.service.dart @@ -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 {