From 31f30aa4b34ac708f8ac82f2bf1e5c31691312c9 Mon Sep 17 00:00:00 2001 From: Jimmy Mayoukou Date: Thu, 30 Jun 2016 10:39:19 -0700 Subject: [PATCH] Return empty bundle when passing an empty map to toBundle Summary: (I swear this was working before...) Right now, when passing an empty map to `toBundle` it returns null: - It feels counter-intuitive to have the data modified without any good reason; - It is different from what iOS does This PR fixes this behavior by returning an empty `Bundle` instead of `null`. It is a breaking change though, and I'm not sure where it goes with the new bridge. Closes https://github.com/facebook/react-native/pull/7847 Differential Revision: D3504024 fbshipit-source-id: 97ca19259fdf3219e8237e44a313645503a695fd --- .../src/main/java/com/facebook/react/bridge/Arguments.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.java index 1772ef52aa6..866104fb196 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.java @@ -154,9 +154,6 @@ public class Arguments { } ReadableMapKeySetIterator iterator = readableMap.keySetIterator(); - if (!iterator.hasNextKey()) { - return null; - } Bundle bundle = new Bundle(); while (iterator.hasNextKey()) {