Skip to content

Commit

Permalink
fix occasional NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
dbachelder committed Jul 27, 2015
1 parent 3c75e56 commit 80126d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static String formatForViewing(String enteredNumber, CardType type) {
if (len <= CC_LEN_FOR_TYPE)
return cleaned;

ArrayList<String> gaps = new ArrayList<String>();
ArrayList<String> gaps = new ArrayList<>();

int segmentLengths[] = { 0, 0, 0 };

Expand Down Expand Up @@ -212,6 +212,7 @@ public static String formatExpirationDate(String text) {
}

public static int securityCodeValid(CardType type) {
if(type == null) return 3;
switch (type) {
case AMEX:
return 4;
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Add the project to your `dependencies`
...
compile 'com.github.dbachelder:CreditCardEntry:1.4.0'
compile 'com.github.dbachelder:CreditCardEntry:1.4.1'
}
```

Expand Down Expand Up @@ -114,6 +114,9 @@ In code:

# Version History

###7/27/2015
- fix occasional NPE

###7/15/2015
- fix for order of operations when invalidating card and calling delegate methods

Expand Down

0 comments on commit 80126d1

Please sign in to comment.