Skip to content

Commit

Permalink
Patch to work around a crash in RN internals (#4426)
Browse files Browse the repository at this point in the history
Co-authored-by: Hailey <me@haileyok.com>
  • Loading branch information
gaearon and haileyok committed Jun 8, 2024
1 parent a2d1cf6 commit 01b7a94
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions patches/react-native+0.74.1.patch
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,19 @@ index b09e653..4c32b31 100644
+}
+
@end
diff --git a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java
index 5f5e1ab..aac00b6 100644
--- a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java
+++ b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java
@@ -99,8 +99,9 @@ public class JavaTimerManager {
}

// If the JS thread is busy for multiple frames we cancel any other pending runnable.
- if (mCurrentIdleCallbackRunnable != null) {
- mCurrentIdleCallbackRunnable.cancel();
+ IdleCallbackRunnable currentRunnable = mCurrentIdleCallbackRunnable;
+ if (currentRunnable != null) {
+ currentRunnable.cancel();
}

mCurrentIdleCallbackRunnable = new IdleCallbackRunnable(frameTimeNanos);

0 comments on commit 01b7a94

Please sign in to comment.