NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference in react-native-capture-protection #55
I am encountering a NullPointerException in react-native-capture-protection on Android 14 devices. The error occurs when attempting to invoke getClass() on a null object. This issue is being reported in Sentry, and it seems to originate from getScreenCaptureCallback() in CaptureProtectionModule.
NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
Stack Trace:
com.captureprotection.CaptureProtectionModule in getScreenCaptureCallback at line 12
com.captureprotection.CaptureProtectionModule in addListener at line 1
com.captureprotection.CaptureProtectionModule in addScreenshotListener
java.lang.reflect.Method in invoke
com.facebook.react.bridge.JavaMethodWrapper in invoke at line 168
com.facebook.react.bridge.JavaModuleWrapper in invoke at line 19
com.facebook.jni.NativeRunnable in run
android.os.Handler in handleCallback at line 1013
android.os.Handler in dispatchMessage at line 101
com.facebook.react.bridge.queue.MessageQueueThreadHandler in dispatchMessage
android.os.Looper in loopOnce at line 226
android.os.Looper in loop at line 328
com.facebook.react.bridge.queue.MessageQueueThreadImpl$4 in run at line 37
java.lang.Thread in run at line 1012
I am encountering a NullPointerException in react-native-capture-protection on Android 14 devices. The error occurs when attempting to invoke getClass() on a null object. This issue is being reported in Sentry, and it seems to originate from getScreenCaptureCallback() in CaptureProtectionModule.
Environment:
React Native Version: 0.75.2 react-native-capture-protection Version: 1.9.12 Android Version: 14
Error Message:
Stack Trace: