私のアプリでは、ユーザーはプロフィールの画像を持っています。Facebookにサインインした場合、プロフィールの画像は現在のFacebookプロフィールの画像に設定されています。私が持っている問題は、ユーザーがFacebookなしでアプリにサインインして、Facebookのデータを取得しようとしたときにアプリケーションがクラッシュした場合です。どのように私はそれを安全にすることができますので、Facebookのデータが取得できない場合は、プロフィールの画像を空白に設定することができます。Swift 2.3 Facebookのプロフィールが返されない場合はクラッシュします
lazy var profileImageView: UIImageView = {
let user = FIRAuth.auth()?.currentUser
let photoUrl = user?.photoURL
let data = NSData(contentsOfURL: photoUrl!)
let profileView = UIImageView()
profileView.image = UIImage(data: data!)
profileView.contentMode = .ScaleAspectFill
profileView.layer.cornerRadius = 16
profileView.layer.masksToBounds = true
profileView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(handleSelectProfileImageView)))
profileView.userInteractionEnabled = true
return profileView
}()
「[致命的なエラー:任意の値をアンラッピングしている間に予期せぬエラーが検出されました」とはどういう意味ですか?](http://stackoverflow.com/questions/32170456/what-does-fatal-error-unexpectedly-found- nil-while-unwrapping-an-optional-valu) – rmaddy