func fetchUser() {
guard let uid = userSession?.uid else { return }
Firestore.firestore().collection("users").document(uid).getDocument { snapshot, _ in
guard let user = try? snapshot?.data(as: User.self) else { return }
self.currentUser = user
}
}
The error is thrown on the "guard let user" line. Any idea on how to fix this error? Also, I am not using Cocoapods ... I am using Firebase from the github sdk