Commit d8fb9503 by Dima Bart

Move assertion to top of initializers.

parent 97372d4d
......@@ -37,9 +37,10 @@
- (instancetype)initWithPaymentToken:(PKPaymentToken *)paymentToken
{
BUYAssert(paymentToken.paymentData.length > 0, @"Failed to initialize BUYApplePayToken. Invalid or nil paymentToken.");
self = [super init];
if (self) {
BUYAssert(paymentToken.paymentData.length > 0, @"Failed to initialize BUYApplePayToken. Invalid or nil paymentToken.");
_paymentToken = paymentToken;
}
return self;
......
......@@ -33,10 +33,10 @@
- (instancetype)initWithPaymentSessionID:(NSString *)paymentSessionID
{
BUYAssert(paymentSessionID.length > 0, @"Failed to initialize BUYCreditCardToken. Invalid or nil payment session ID.");
self = [super init];
if (self) {
BUYAssert(paymentSessionID.length > 0, @"Failed to initialize BUYCreditCardToken. Invalid or nil payment session ID.");
_paymentSessionID = paymentSessionID;
}
return self;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment