From eba356fb135171b49c2062e9ccac73335e251491 Mon Sep 17 00:00:00 2001 From: zongjingyao Date: Thu, 15 Dec 2016 22:28:48 -0800 Subject: [PATCH] result in RCTAsyncStorage.multiGet could be null. Summary: App will crash if result is null. Closes https://github.com/facebook/react-native/pull/10338 Differential Revision: D4335305 Pulled By: lacker fbshipit-source-id: 4910bfd7c56525a2ef1b252b56b8debd21fa2bae --- Libraries/Storage/AsyncStorage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Storage/AsyncStorage.js b/Libraries/Storage/AsyncStorage.js index a0666c06c..b8b682027 100644 --- a/Libraries/Storage/AsyncStorage.js +++ b/Libraries/Storage/AsyncStorage.js @@ -264,7 +264,7 @@ var AsyncStorage = { // Is there a way to avoid using the map but fix the bug in this breaking test? // https://github.com/facebook/react-native/commit/8dd8ad76579d7feef34c014d387bf02065692264 const map = {}; - result.forEach(([key, value]) => map[key] = value); + result && result.forEach(([key, value]) => { map[key] = value; return value; }); const reqLength = getRequests.length; for (let i = 0; i < reqLength; i++) { const request = getRequests[i];