vitaliy-paliy / Messenger

iOS - Real-time messaging app 🎨
Apache License 2.0
616 stars 87 forks source link

Unexpectedly found nil in getUsersList #6

Closed LoopingLouieX closed 4 years ago

LoopingLouieX commented 4 years ago

After clicking on "Add Friends" it find's nil in the following function unexpectedly.
This also happens in the demo app (master branch).

 private func getUsersList() {
        userListNetworking.fetchUsers { usersList in
            let sortedUserList = Array(usersList.values).sorted { (friend1, friend2) -> Bool in
                return friend1.name < friend2.name.     //Xcode showing the nil here
            }
            self.users = sortedUserList
            self.blankLoadingView.isHidden = true
            self.tableView.reloadData()
        }
    }
vitaliy-paliy commented 4 years ago

Hey, I've fixed this bug in the 1.4 update.