diff --git a/data/src/main/java/com/canopas/yourspace/data/service/user/ApiUserService.kt b/data/src/main/java/com/canopas/yourspace/data/service/user/ApiUserService.kt index 3af443e8..4c35127a 100644 --- a/data/src/main/java/com/canopas/yourspace/data/service/user/ApiUserService.kt +++ b/data/src/main/java/com/canopas/yourspace/data/service/user/ApiUserService.kt @@ -49,7 +49,8 @@ class ApiUserService @Inject constructor( suspend fun getUser(userId: String): ApiUser? { return try { - val user = userRef.document(userId).get().await().toObject(ApiUser::class.java) + val user = userRef.document(userId.takeIf { it.isNotBlank() } ?: "null").get().await() + .toObject(ApiUser::class.java) when { user == null -> null currentUser == null || user.id != currentUser.id -> user