I am building a social app with an avatar like instagram and using Amazon S3 for storage. For some reason the app compiles fine but when I scroll on the search page after uploading an avatar the app crashes and I get this error.
Thread 1 - fatal error - unexpectedly found nil while unwrapping an Optional value
This is the line of code where the error shows up...
private func avatarURL(for username: String) -> URL {
return "https://s3.amazonaws.com/rest-of-link/\(username.lowercased())-avatar.jpg".URL!
}
I can scroll on the feed page with avatars showing just fine. Also, when I change the link to a black web page there are no avatars but I can scroll just fine without getting this error. Any idea what this could be?