Skip to content

Commit 1015194

Browse files
dulmandakhfacebook-github-bot
authored andcommitted
fix ReadableNativeMap.getNullableValue to match signature (#30121)
Summary: This PR changes ReadableNativeMap.getNullableValue to return null if key not found, instead of throwing exception. This matches method signature and nullable annotation. ## Changelog [Android] [Changed] - fix ReadableNativeMap.getNullableValue to match signature Pull Request resolved: #30121 Test Plan: RNTester app builds and runs as expected, and getNullableValue will return null instead of throwing exception. Reviewed By: JoshuaGross Differential Revision: D24164302 Pulled By: fkgozali fbshipit-source-id: 572c1d4ae5fd493aa0018c2df1dfc7fc91cb4b6b
1 parent d765565 commit 1015194

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeMap.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private <T> T getValue(String name, Class<T> type) {
120120
if (hasKey(name)) {
121121
return getLocalMap().get(name);
122122
}
123-
throw new NoSuchKeyException(name);
123+
return null;
124124
}
125125

126126
private @Nullable <T> T getNullableValue(String name, Class<T> type) {

0 commit comments

Comments
 (0)