Skip to content

Potential NullPointerException in hasPermissions #305

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

Closed
1 of 2 tasks
geraintwhite opened this issue Oct 22, 2020 · 0 comments · Fixed by #306
Closed
1 of 2 tasks

Potential NullPointerException in hasPermissions #305

geraintwhite opened this issue Oct 22, 2020 · 0 comments · Fixed by #306

Comments

@geraintwhite
Copy link
Contributor

Bug report

  • Reproduced on:
  • Android
  • iOS

Description

I haven't encountered this crash myself, but looking at the Google Play developer console for my app I can see the exception occurs semi-frequently.

image

It looks like it is cause when ContextCompat.checkSelfPermission(currentActivity, permission); is called here and currentActivity is null.

A simple null check will probably do the trick.

Versions

- Callkeep: 3.1.1
- React Native: 0.59.10
- Android: 8/9/10
- Phone model: Galaxy S8, Galaxy A20e, Galaxy A70, Acer Liquid S1

Logs

java.lang.NullPointerException: 
  at android.support.v4.content.ContextCompat.checkSelfPermission (ContextCompat.java:544)
  at io.wazo.callkeep.RNCallKeepModule.hasPermissions (RNCallKeepModule.java:513)
  at io.wazo.callkeep.RNCallKeepModule.startCall (RNCallKeepModule.java:184)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372)
  at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:158)
  at com.facebook.react.bridge.queue.NativeRunnable.run (Native Method)
  at android.os.Handler.handleCallback (Handler.java:873)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:29)
  at android.os.Looper.loop (Looper.java:214)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:232)
  at java.lang.Thread.run (Thread.java:764)
danjenkins pushed a commit to nimbleape/react-native-callkeep-1 that referenced this issue Jan 6, 2021

Verified

This commit was signed with the committer’s verified signature.
danjenkins Dan Jenkins
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

Successfully merging a pull request may close this issue.

1 participant