SupportLeanbackDemos: Fixed password crash when no payment is selected
am: be98b3af70
* commit 'be98b3af70d0fb280dd688040b04880a9e4d543f':
SupportLeanbackDemos: Fixed password crash when no payment is selected
This commit is contained in:
@@ -420,8 +420,10 @@ public class GuidedStepActivity extends Activity {
|
|||||||
|
|
||||||
boolean isPaymentValid() {
|
boolean isPaymentValid() {
|
||||||
CharSequence paymentType = findActionById(PAYMENT).getDescription();
|
CharSequence paymentType = findActionById(PAYMENT).getDescription();
|
||||||
return paymentType.subSequence(0, 4).toString().equals("Visa") ||
|
return (paymentType.length() >= 4 &&
|
||||||
paymentType.subSequence(0, 6).toString().equals("Master");
|
paymentType.subSequence(0, 4).toString().equals("Visa")) ||
|
||||||
|
(paymentType.length() >= 6 &&
|
||||||
|
paymentType.subSequence(0, 6).toString().equals("Master"));
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isPasswordValid() {
|
boolean isPasswordValid() {
|
||||||
|
|||||||
@@ -422,8 +422,10 @@ public class GuidedStepSupportActivity extends FragmentActivity {
|
|||||||
|
|
||||||
boolean isPaymentValid() {
|
boolean isPaymentValid() {
|
||||||
CharSequence paymentType = findActionById(PAYMENT).getDescription();
|
CharSequence paymentType = findActionById(PAYMENT).getDescription();
|
||||||
return paymentType.subSequence(0, 4).toString().equals("Visa") ||
|
return (paymentType.length() >= 4 &&
|
||||||
paymentType.subSequence(0, 6).toString().equals("Master");
|
paymentType.subSequence(0, 4).toString().equals("Visa")) ||
|
||||||
|
(paymentType.length() >= 6 &&
|
||||||
|
paymentType.subSequence(0, 6).toString().equals("Master"));
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isPasswordValid() {
|
boolean isPasswordValid() {
|
||||||
|
|||||||
Reference in New Issue
Block a user