killserver / react-native-screenshot-prevent

MIT License
98 stars 38 forks source link

Fix: nullPointerException when `getCurrentActivity()` returns null #38

Closed kaladivo closed 6 months ago

kaladivo commented 8 months ago

In my app there is this error thrown in some scenarios:

NullPointerException: Attempt to invoke virtual method 'android.view.Window android.app.Activity.getWindow()' on a null object reference

at: com.killserver.screenshotprev.RNScreenshotPreventModule$4 in run at line 73

This PR should fix it.