guard statements
Here’s the code if you want to experiment with it:
guard let user = getUser() else {
throw UserError.noUser
}
guard let address = getAddress(of: user) else {
throw UserError.noAddress
}
guard let paymentMethod = getPaymentMethod(of: user) else {
throw UserError.noPaymentMethod
}
// do something