Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(android): add null checks #4168

Merged

Conversation

KrzysztofMoch
Copy link
Member

Summary

Add some null checks

Motivation

Fix edge case crashes

Changes

Test plan

  • should not crash app now

} catch (Exception ignored) {}

playbackServiceBinder = null;
}

@Override
public void onNullBinding(ComponentName name) {
DebugLog.e(TAG, "Cloud not register ExoPlayer");
DebugLog.e(TAG, "Could not register ExoPlayer");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

: ❤️

@@ -900,25 +900,33 @@ public void onServiceConnected(ComponentName name, IBinder service) {
playbackServiceBinder = (PlaybackServiceBinder) service;

try {
playbackServiceBinder.getService().registerPlayer(player,
Objects.requireNonNull((Class<Activity>) (themedReactContext.getCurrentActivity()).getClass()));
Activity currentActivity = themedReactContext.getCurrentActivity();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found such issue when starting the app while screen is locked ... Not sure if it helps ...

@freeboub freeboub merged commit b74cb59 into TheWidlarzGroup:master Sep 14, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants