diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/debuggingoverlay/DebuggingOverlay.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/debuggingoverlay/DebuggingOverlay.kt index a900de5b913ba6..c82b3f9a5802f8 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/debuggingoverlay/DebuggingOverlay.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/debuggingoverlay/DebuggingOverlay.kt @@ -35,8 +35,10 @@ internal class DebuggingOverlay(context: Context) : View(context) { for (traceUpdate in traceUpdates) { val traceUpdateId = traceUpdate.id if (traceUpdateIdToCleanupRunnableMap.containsKey(traceUpdateId)) { - UiThreadUtil.removeOnUiThread(traceUpdateIdToCleanupRunnableMap[traceUpdateId]) - traceUpdateIdToCleanupRunnableMap.remove(traceUpdateId) + traceUpdateIdToCleanupRunnableMap[traceUpdateId]?.also { runnable -> + UiThreadUtil.removeOnUiThread(runnable) + traceUpdateIdToCleanupRunnableMap.remove(traceUpdateId) + } } traceUpdatesToDisplayMap[traceUpdateId] = traceUpdate diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactRawTextShadowNode.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactRawTextShadowNode.java index 4c7af8c72e096a..e43e43b5ef40c6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactRawTextShadowNode.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactRawTextShadowNode.java @@ -8,6 +8,7 @@ package com.facebook.react.views.text; import androidx.annotation.Nullable; +import com.facebook.infer.annotation.Nullsafe; import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.uimanager.ReactShadowNode; import com.facebook.react.uimanager.ReactShadowNodeImpl; @@ -17,6 +18,7 @@ * {@link ReactShadowNode} class for pure raw text node (aka {@code textContent} in terms of DOM). * Raw text node can only have simple string value without any attributes, properties or state. */ +@Nullsafe(Nullsafe.Mode.LOCAL) public class ReactRawTextShadowNode extends ReactShadowNodeImpl { @VisibleForTesting public static final String PROP_TEXT = "text"; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributes.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributes.java index de72c0e3914efd..f1fbcfe9ac55d4 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributes.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributes.java @@ -9,6 +9,7 @@ import androidx.annotation.NonNull; import com.facebook.common.logging.FLog; +import com.facebook.infer.annotation.Nullsafe; import com.facebook.react.common.ReactConstants; import com.facebook.react.uimanager.PixelUtil; import com.facebook.react.uimanager.ViewDefaults; @@ -20,6 +21,7 @@ * the rendered aka effective value. For example, to figure out the rendered/effective font size, * you need to take into account the fontSize, maxFontSizeMultiplier, and allowFontScaling props. */ +@Nullsafe(Nullsafe.Mode.LOCAL) public class TextAttributes { // Setting the default to 0 indicates that there is no max. public static final float DEFAULT_MAX_FONT_SIZE_MULTIPLIER = 0.0f;