Skip to content

Commit

Permalink
fix: check if audioManager exist before use
Browse files Browse the repository at this point in the history
  • Loading branch information
martindonadieu committed Mar 3, 2022
1 parent 5c5ef52 commit ae10631
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ public void load() {
this.audioManager = (AudioManager) getBridge()
.getActivity()
.getSystemService(Context.AUDIO_SERVICE);
this.audioManager.requestAudioFocus(
this,
AudioManager.STREAM_MUSIC,
AudioManager.AUDIOFOCUS_GAIN
);
if (this.audioManager != null) {
this.audioManager.requestAudioFocus(
this,
AudioManager.STREAM_MUSIC,
AudioManager.AUDIOFOCUS_GAIN
);
}
}

@Override
Expand Down

0 comments on commit ae10631

Please sign in to comment.