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

fix crash java.lang.NullPointerException #7

Closed
taliasegev opened this issue Apr 22, 2018 · 1 comment
Closed

fix crash java.lang.NullPointerException #7

taliasegev opened this issue Apr 22, 2018 · 1 comment

Comments

@taliasegev
Copy link
Contributor

Our app crashed on GooglePlay automatic tests. The reason was -
Attempt to invoke virtual method 'void android.telephony.TelephonyManager.listen(android.telephony.PhoneStateListener, int)' on a null object reference

I would like to suggest a fix for the package, making it safe for use. I've added try catch, checking if object is null, and added failure callback for each function.
I've changed the version to 2.0.0 since it is a major fix, changing the functions signatures (due to the failure callback).
I believe it is important for the stability of the package, and it is much safer to use it this way.
Please approve my PR.
Example for the new use -

Telephony.getCellInfo( cellInfo => { // Do something with result }, error => { // Handle error, exception from Android native code }

Thanks,
Talia Segev

@taliasegev
Copy link
Contributor Author

#8

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

No branches or pull requests

2 participants