Commit e34ac0d
fix for android crash (#35)
* fix for android crash
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`.
* remove unnecessary parens
---------
Co-authored-by: Marc Shilling <marcshilling@gmail.com>1 parent 82e707e commit e34ac0d
2 files changed
Lines changed: 10 additions & 8 deletions
File tree
- android/src/main/java/com/marcshilling/idletimer
- ios/RNIdleTimer
Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | | - | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | | - | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
0 commit comments