fatal error: unexpectedly found nil while unwrapping an Optional value (Swift 3) : <p>this question has been asked a million times, but it still confuses me. 
I have the app which connects to the server to in order to login and everything is fine until the user input is incorrect and the server returns nil. How can I prevent my app from crashing</p>

<pre><code>   // A method for the login button
       @IBAction func loginButton(_ sender: UIButton) {
    parameters["email"] = email?.text
    parameters["password"] = password?.text
    Alamofire.request(url, method: .post, parameters: parameters, encoding: URLEncoding.httpBody, headers: token).responseJSON {
        (response) in
        print(response.result.value!)

        // Check if the servers return token and go to the next page
        if response.result.value != nil {
        self.performSegue(withIdentifier: "loginSegue", sender: nil)
        }
        if let tokenString = response.result.value as? String {
            self.token["X-Auth-Token"] = tokenString
        }
    }
}
</code></pre>
