Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE on blur if no card number entered #6

Closed
biddster opened this issue Jun 26, 2015 · 11 comments
Closed

NPE on blur if no card number entered #6

biddster opened this issue Jun 26, 2015 · 11 comments
Assignees
Labels

Comments

@biddster
Copy link

I have the credit card setup to be blank so a user can input a new card. If I click in the credit card field and then click out without entering a number, I get this exception:

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
            at com.vinaygaba.creditcardview.CreditCardView$2.onFocusChange(CreditCardView.java:215)
            at android.view.View.onFocusChanged(View.java:5206)
            at android.widget.TextView.onFocusChanged(TextView.java:7913)
            at android.view.View.clearFocusInternal(View.java:5089)
            at android.view.View.unFocus(View.java:5122)
            at android.view.ViewGroup.requestChildFocus(ViewGroup.java:658)
            at android.view.View.handleFocusGainInternal(View.java:4955)
            at android.view.View.requestFocusNoSearch(View.java:7678)
            at android.view.View.requestFocus(View.java:7657)
            at android.view.View.requestFocus(View.java:7624)
            at android.view.View.requestFocus(View.java:7603)
            at android.view.View.onTouchEvent(View.java:9439)
            at android.widget.TextView.onTouchEvent(TextView.java:7965)
            at android.view.View.dispatchTouchEvent(View.java:8471)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2369)
            at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1719)
            at android.app.Activity.dispatchTouchEvent(Activity.java:2742)
            at android.support.v7.internal.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:59)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2330)
            at android.view.View.dispatchPointerEvent(View.java:8666)
            at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4123)
            at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3989)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3544)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3597)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3563)
            at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3680)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3571)
            at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3737)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3544)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3597)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3563)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3571)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3544)
            at android.view.ViewRootImpl.deliverInputEvent(Vi

@biddster biddster changed the title NPE on blur if no credit card entered NPE on blur if no card number entered Jun 26, 2015
@vinaygaba
Copy link
Owner

Hi,
I have identified what's causing the bug and will be fixing it later today! Appreciate you pointing this out. Thanks!

@vinaygaba vinaygaba added the bug label Jun 26, 2015
@vinaygaba vinaygaba self-assigned this Jun 26, 2015
@biddster
Copy link
Author

Pleasure, thanks for the fast response.

@vinaygaba
Copy link
Owner

Hi,
Could you be a bit more detailed with the steps that caused this error. I was trying to replicate it but clicking on the filed, not entering any value and clicking out without entering a number did not result in an NPE. I might be missing some step.

@vinaygaba
Copy link
Owner

Also, which version of the library are you using?

@vinaygaba
Copy link
Owner

@biddster Just wanted to confirm if you are still seeing this issue in v1.0.2 of the library after you cleared the cache?

@vinaygaba
Copy link
Owner

Hi @biddster,
Closing this issue as I am not able to replicate it. If this issue persists for you, could you please reply to my queries above so that I can fix it asap :)

@biddster
Copy link
Author

Apologies for not getting back to you sooner. I'm on holiday and only
infrequently get a data connection. I'm back in the office on Wednesday and
will try to provide more information.

On Fri, 26 Jun 2015 19:30 Vinay Gaba notifications@github.com wrote:

Hi @biddster https://github.com/biddster,
Closing this issue as I am not able to replicate it. If this issue
persists for you, could you please reply to my queries above so that I can
fix it asap :)


Reply to this email directly or view it on GitHub
#6 (comment)
.

@vinaygaba
Copy link
Owner

Hi @biddster,
No issues at all! I can wait till then :) Have fun!

vinaygaba added a commit that referenced this issue Jun 30, 2015
@vinaygaba
Copy link
Owner

@biddster I was able to reproduce this and have fixed it!

@biddster
Copy link
Author

Brilliant, many thanks.

On Tue, 30 Jun 2015 07:35 Vinay Gaba notifications@github.com wrote:

@biddster https://github.com/biddster I was able to reproduce this and
have fixed it!


Reply to this email directly or view it on GitHub
#6 (comment)
.

@biddster
Copy link
Author

biddster commented Jul 1, 2015

Confirming fixed in 1.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants