Skip to content

Commit 9056521

Browse files
committed
(FlutterwavePayViewController.swift): added safety check to avoid partial data assignmeny
1 parent c1f3855 commit 9056521

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

FlutterwaveSDK/Classes/UI/NewExtraFlutterwave/FlutterWave+UIPickerView.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,9 @@ extension FlutterwavePayViewController : UITextFieldDelegate,CardSelect,UIPicker
4141

4242
}
4343
if (textField == debitCardView.cardNumberTextField){
44-
if let count = textField.text?.count {
45-
if count == 6{
46-
flutterwaveCardClient.amount = self.amount
47-
flutterwaveCardClient.cardfirst6 = textField.text
48-
49-
}
44+
if let text = textField.text, text.count == 6 {
45+
flutterwaveCardClient.amount = self.amount
46+
flutterwaveCardClient.cardfirst6 = text
5047
}
5148
}
5249
}

0 commit comments

Comments
 (0)