marcshilling / react-native-idle-timer

A cross-platform bridge that allows you to enable and disable the screen idle timer in your React Native app
MIT License
216 stars 42 forks source link

fix for android crash #35

Closed heath-clink closed 8 months ago

heath-clink commented 8 months ago

For some reason, a recent commit removed the check for a null return from getCurrentActivity(). But since getCurrentActivity() might return null, the app will crash with a NullPointerException.

This restores the null check.

It also fixes inconsistent handling of null tag argument in both iOS and Android. This does not affect usage from JS because the JS interface will not pass null to that argument; however other native code could still call these methods and pass null for tag.

Fixes: #32

marcshilling commented 8 months ago

LGTM - thanks!