Skip to content

Commit

Permalink
fix(android): avoid crash on react-native reload if not initialized
Browse files Browse the repository at this point in the history
If initialize was called correctly, accessTokenTracker would always be non-null

But just in case the state is not correctly initialized, we can avoid crashing
  • Loading branch information
mikehardy committed Nov 13, 2023
1 parent 36a762a commit 60ed902
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ protected void onCurrentAccessTokenChanged(AccessToken oldAccessToken, AccessTok
@Override
public void onCatalystInstanceDestroy() {
super.onCatalystInstanceDestroy();
accessTokenTracker.stopTracking();
if (accessTokenTracker != null) {
accessTokenTracker.stopTracking();
}
}

/**
Expand Down

0 comments on commit 60ed902

Please sign in to comment.