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

Can't instantiate MaskedEditText programmatically #39

Open
ildar2 opened this issue Jun 4, 2018 · 1 comment
Open

Can't instantiate MaskedEditText programmatically #39

ildar2 opened this issue Jun 4, 2018 · 1 comment
Labels

Comments

@ildar2
Copy link

ildar2 commented Jun 4, 2018

You can't instantiate MaskedEditText programmatically with new MaskedEditText(mContext) constructor, because when you call setMask() there is no charRepresentation for generatePositionArrays() to match every mask char therefore rawToMask has zero length and selection = rawToMask[0]; fails with ArrayIndexOutOfBoundsException. BUT you can't setCharRepresentation() either, because mask is null and there is no null check in generatePositionArrays() on mask.length() call.
I guess setting default charRepresentation statically or setting mask to "" would fix the issue

@egslava
Copy link
Owner

egslava commented Sep 8, 2019

Thanks for the report! One of the best here. Don't you want to make the pull-request, btw? I'll provide all the support for you to finish it.

@egslava egslava added the bug label Sep 8, 2019
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