Skip to content

Commit

Permalink
Make constructor arg of ReactContextBaseJavaModule @nullable
Browse files Browse the repository at this point in the history
Summary:
ExceptionManagers are created before the `ReactApplicationContext`. Once we make them all TurboModule-compatible, they'll also subclasses `ReactContextBaseJavaModule`. This means that they'll need to be created with `ReactApplicationContext`. Since one isn't available, we'll have to call `super(null)` in their constructor.

Changelog:
[Android][Changed] - Make ReactApplicationContext nullable as the constructor argument of ReactContextBaseJavaModule

Reviewed By: PeteTheHeat

Differential Revision: D18935950

fbshipit-source-id: a643a10a42cf36a2a2d6fde87795965f16295d43
  • Loading branch information
RSNara authored and facebook-github-bot committed Dec 11, 2019
1 parent a8fbc5b commit f8d5c5b
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import static com.facebook.infer.annotation.ThreadConfined.ANY;

import android.app.Activity;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Assertions;
Expand All @@ -28,7 +27,7 @@ public ReactContextBaseJavaModule() {
mReactApplicationContext = null;
}

public ReactContextBaseJavaModule(@NonNull ReactApplicationContext reactContext) {
public ReactContextBaseJavaModule(@Nullable ReactApplicationContext reactContext) {
mReactApplicationContext = reactContext;
}

Expand Down

0 comments on commit f8d5c5b

Please sign in to comment.