Fix null deref in RN timer code
Reviewed By: astreet Differential Revision: D3029772 fb-gh-sync-id: 0af13208659093b14013c0ee3c00b2438fadca9c shipit-source-id: 0af13208659093b14013c0ee3c00b2438fadca9c
This commit is contained in:
parent
e9c79f85ba
commit
13c49e2006
|
@ -241,12 +241,17 @@ public final class Timing extends ReactContextBaseJavaModule implements Lifecycl
|
|||
@ReactMethod
|
||||
public void deleteTimer(ExecutorToken executorToken, int timerId) {
|
||||
synchronized (mTimerGuard) {
|
||||
Timer timer = mTimerIdsToTimers.get(executorToken).get(timerId);
|
||||
if (timer != null) {
|
||||
SparseArray<Timer> timersForContext = mTimerIdsToTimers.get(executorToken);
|
||||
if (timersForContext == null) {
|
||||
return;
|
||||
}
|
||||
Timer timer = timersForContext.get(timerId);
|
||||
if (timer == null) {
|
||||
return;
|
||||
}
|
||||
// We may have already called/removed it
|
||||
mTimerIdsToTimers.remove(timerId);
|
||||
mTimers.remove(timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue