diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarker.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarker.java index ebfd755f8f7029..bf754a14952b6f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarker.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarker.java @@ -193,8 +193,8 @@ private static void notifyNativeMarker(ReactMarkerConstants name, @Nullable Long nativeLogMarker(name.name(), now); // Then send all cached native ReactMarkers - while (!sNativeReactMarkerQueue.isEmpty()) { - ReactMarkerRecord record = sNativeReactMarkerQueue.poll(); + ReactMarkerRecord record; + while ((record = sNativeReactMarkerQueue.poll()) != null) { nativeLogMarker(record.getMarkerName(), record.getMarkerTime()); } } else {