Skip to content

fix(android): add null check for player in videoLoaded() to prevent NPE#4903

Closed
vanhci wants to merge 1 commit into
TheWidlarzGroup:support/6.x.xfrom
vanhci:fix/issue-4902-null-check
Closed

fix(android): add null check for player in videoLoaded() to prevent NPE#4903
vanhci wants to merge 1 commit into
TheWidlarzGroup:support/6.x.xfrom
vanhci:fix/issue-4902-null-check

Conversation

@vanhci
Copy link
Copy Markdown

@vanhci vanhci commented May 20, 2026

Fix Summary

Add null check for in method to prevent NullPointerException.

Bug:

Root cause: Race condition where ExoPlayer listener posts callback on main looper, before it's dispatched the player is released (nulled), then the callback fires and causes NPE when calling .

Fix: Changed:

To:

Fixes #4902

Fixes NullPointerException in ReactExoplayerView.videoLoaded() when player is
released before the callback is dispatched. The race condition occurs when
ExoPlayer listener posts a callback on the main looper, but before it's
dispatched the player is released (nulled), then the callback fires and
causes NPE when calling player.isPlayingAd().

Fixes: #4902
@Osilos
Copy link
Copy Markdown

Osilos commented May 20, 2026

@vanhci you push a PR very quickly to fix this issue a just open Thanks !
How did you do to do it so fast ?

@vanhci vanhci closed this by deleting the head repository May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

2 participants