Skip to content

Commit 8a33b75

Browse files
ryancatfacebook-github-bot
authored andcommitted
getModule API may return null module
Summary: The native module might be null, and that should not be an exception thrown by the subclassed method. Changelog: [Android][Internal] - Mark getModule API to be nullable Reviewed By: mdvacca, makovkastar Differential Revision: D37900294 fbshipit-source-id: a4ecc9804b95bf0512554e96985f272b435e33b2
1 parent b66db7a commit 8a33b75

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
package com.facebook.react;
99

1010
import androidx.annotation.NonNull;
11+
import androidx.annotation.Nullable;
1112
import com.facebook.react.bridge.ModuleHolder;
1213
import com.facebook.react.bridge.ModuleSpec;
1314
import com.facebook.react.bridge.NativeModule;
@@ -42,7 +43,8 @@ public List<NativeModule> createNativeModules(ReactApplicationContext reactConte
4243
* @param reactContext
4344
* @return
4445
*/
45-
public abstract NativeModule getModule(String name, final ReactApplicationContext reactContext);
46+
public abstract @Nullable NativeModule getModule(
47+
String name, final ReactApplicationContext reactContext);
4648

4749
/**
4850
* This is a temporary method till we implement TurboModules. Once we implement TurboModules, we

0 commit comments

Comments
 (0)