Skip to content

Commit 6f00386

Browse files
made signature similar to java
1 parent 4a72040 commit 6f00386

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UiThreadUtil.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383

8484
/** Removes the given [Runnable] on the UI thread. */
8585
@JvmStatic
86-
public fun removeOnUiThread(runnable: Runnable?) {
87-
runnable?.let { mainHandler.removeCallbacks(it) }
86+
public fun removeOnUiThread(runnable: Runnable) {
87+
mainHandler.removeCallbacks(runnable)
8888
}
8989
}
9090

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/debuggingoverlay/DebuggingOverlay.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ internal class DebuggingOverlay(context: Context) : View(context) {
3535
for (traceUpdate in traceUpdates) {
3636
val traceUpdateId = traceUpdate.id
3737
if (traceUpdateIdToCleanupRunnableMap.containsKey(traceUpdateId)) {
38-
UiThreadUtil.removeOnUiThread(traceUpdateIdToCleanupRunnableMap[traceUpdateId])
38+
traceUpdateIdToCleanupRunnableMap[traceUpdateId]?.let { runnable ->
39+
UiThreadUtil.removeOnUiThread(runnable)
40+
}
3941
traceUpdateIdToCleanupRunnableMap.remove(traceUpdateId)
4042
}
4143

0 commit comments

Comments
 (0)