Skip to content

Commit

Permalink
Revert D48588375: Make TurboReactPackage.getModule no nullable
Browse files Browse the repository at this point in the history
Differential Revision:
D48588375

Original commit changeset: e510f76ea027

Original Phabricator Diff: D48588375

fbshipit-source-id: 62c8b062c8316bb7a90fced6390eb20f8274ea88
  • Loading branch information
Ergul Azizler authored and facebook-github-bot committed Aug 25, 2023
1 parent e716459 commit c46858a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public List<NativeModule> createNativeModules(ReactApplicationContext reactConte
* @param name name of the Native Module
* @param reactContext {@link ReactApplicationContext} context for this
*/
public abstract NativeModule getModule(String name, final ReactApplicationContext reactContext);
public abstract @Nullable NativeModule getModule(
String name, final ReactApplicationContext reactContext);

/**
* This is a temporary method till we implement TurboModules. Once we implement TurboModules, we
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public MainReactPackage(MainPackageConfig config) {
}

@Override
public NativeModule getModule(String name, ReactApplicationContext context) {
public @Nullable NativeModule getModule(String name, ReactApplicationContext context) {
switch (name) {
case AccessibilityInfoModule.NAME:
return new AccessibilityInfoModule(context);
Expand Down Expand Up @@ -151,8 +151,7 @@ public NativeModule getModule(String name, ReactApplicationContext context) {
case DevToolsSettingsManagerModule.NAME:
return new DevToolsSettingsManagerModule(context);
default:
throw new IllegalArgumentException(
"Could not find Native module for " + name + " in MainReactPackage.");
return null;
}
}

Expand Down

0 comments on commit c46858a

Please sign in to comment.